]> granicus.if.org Git - clang/commitdiff
Fix PR13065.
authorDavid Blaikie <dblaikie@gmail.com>
Fri, 15 Jun 2012 00:47:13 +0000 (00:47 +0000)
committerDavid Blaikie <dblaikie@gmail.com>
Fri, 15 Jun 2012 00:47:13 +0000 (00:47 +0000)
This condition (added in r158093) was overly conservative.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158483 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Lex/Lexer.cpp
test/Preprocessor/comment_save.c

index 9662f9d90975799bf566ae663c3019f9b4faa54d..208951faf38c3cbbfceb0563de3395a1aefd9490 100644 (file)
@@ -2631,7 +2631,7 @@ LexNextToken:
       ParsingPreprocessorDirective = false;
 
       // Restore comment saving mode, in case it was disabled for directive.
-      if (!LexingRawMode)
+      if (PP)
         SetCommentRetentionState(PP->getCommentRetentionState());
 
       // Since we consumed a newline, we are back at the start of a line.
index b86004272b2025303cb572b72976170b8ebaecf3..996c14ca976e754bc7bf9dbf7a1275eea9aad305 100644 (file)
@@ -6,3 +6,7 @@
 /* bar */
 // CHECK: /* bar */
 
+#if FOO
+#endif
+/* baz */
+// CHECK: /* baz */