[cfe-commits] r97253 - in /cfe/trunk: lib/Lex/PPExpressions.cpp test/Preprocessor/directive-invalid.c

Chris Lattner sabre at nondot.org
Fri Feb 26 11:42:53 PST 2010


Author: lattner
Date: Fri Feb 26 13:42:53 2010
New Revision: 97253

URL: http://llvm.org/viewvc/llvm-project?rev=97253&view=rev
Log:
fix rdar://7683173, rejecting an invalid conditional


Added:
    cfe/trunk/test/Preprocessor/directive-invalid.c
Modified:
    cfe/trunk/lib/Lex/PPExpressions.cpp

Modified: cfe/trunk/lib/Lex/PPExpressions.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Lex/PPExpressions.cpp?rev=97253&r1=97252&r2=97253&view=diff
==============================================================================
--- cfe/trunk/lib/Lex/PPExpressions.cpp (original)
+++ cfe/trunk/lib/Lex/PPExpressions.cpp Fri Feb 26 13:42:53 2010
@@ -106,7 +106,7 @@
 
   // Consume identifier.
   Result.setEnd(PeekTok.getLocation());
-  PP.LexNonComment(PeekTok);
+  PP.LexUnexpandedToken(PeekTok);
 
   // If we are in parens, ensure we have a trailing ).
   if (LParenLoc.isValid()) {

Added: cfe/trunk/test/Preprocessor/directive-invalid.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Preprocessor/directive-invalid.c?rev=97253&view=auto
==============================================================================
--- cfe/trunk/test/Preprocessor/directive-invalid.c (added)
+++ cfe/trunk/test/Preprocessor/directive-invalid.c Fri Feb 26 13:42:53 2010
@@ -0,0 +1,7 @@
+// RUN: %clang_cc1 -E -verify %s
+// rdar://7683173
+
+#define r_paren )
+#if defined( x r_paren  // expected-error {{missing ')' after 'defined'}} \
+                        // expected-note {{to match this '('}}
+#endif





More information about the cfe-commits mailing list