// directive seen, handle it for the multiple-include optimization.
if (CurPPLexer->getConditionalStackDepth() == 0) {
if (!ReadAnyTokensBeforeDirective && IfNDefMacro && ConditionalTrue)
- CurPPLexer->MIOpt.EnterTopLevelIfndef(IfNDefMacro, ConditionalBegin);
+ // FIXME: Pass in the location of the macro name, not the 'if' token.
+ CurPPLexer->MIOpt.EnterTopLevelIfndef(IfNDefMacro, IfToken.getLocation());
else
CurPPLexer->MIOpt.EnterTopLevelConditional();
}
// CHECK: {{^}} ^~~~~~~~~
// CHECK: {{^}} bad_header_guard
+#include "Inputs/bad-header-guard-defined.h"
+// CHECK: In file included from {{.*}}header.cpp:{{[0-9]*}}:
+// CHECK: {{.*}}bad-header-guard-defined.h:1:2: warning: 'foo' is used as a header guard here, followed by #define of a different macro
+// CHECK: {{^}}#if !defined(foo)
+// CHECK: {{^}} ^~
+// CHECK: {{.*}}bad-header-guard-defined.h:2:9: note: 'goo' is defined here; did you mean 'foo'?
+// CHECK: {{^}}#define goo
+// CHECK: {{^}} ^~~
+// CHECK: {{^}} foo
+
#include "Inputs/multiple.h"
#include "Inputs/multiple.h"
#include "Inputs/multiple.h"
// CHECK: {{^}} ^~~~~
// CHECK: {{^}} multiple
-// CHECK: 2 warnings generated.
+// CHECK: 3 warnings generated.