[PATCH] Warn on malformed header guards

Richard Trieu rtrieu at google.com
Wed Jun 12 14:24:52 PDT 2013



================
Comment at: include/clang/Lex/MultipleIncludeOpt.h:103
@@ +102,3 @@
+  bool getImmediatelyAfterTopLevelIfndef() const {
+    return ImmediatelyAfterTopLevelIfndef;
+  }
----------------
Richard Smith wrote:
> Maybe this should be "ImmediatelyAfterTopLevelIfndef && !ReadAnyTokens"? I think we don't want this to fire on:
> 
> #ifndef FOO
> some stuff here
> #define BAR
> #endif
Fixed by adding "ImmediatelyAfterTopLevelIfndef == false;" to ReadToken().


http://llvm-reviews.chandlerc.com/D898



More information about the cfe-commits mailing list