summaryrefslogtreecommitdiffstats
path: root/clang
diff options
context:
space:
mode:
Diffstat (limited to 'clang')
-rw-r--r--clang/lib/Lex/PPDirectives.cpp1
-rw-r--r--clang/test/Preprocessor/skipping_unclean.c9
2 files changed, 10 insertions, 0 deletions
diff --git a/clang/lib/Lex/PPDirectives.cpp b/clang/lib/Lex/PPDirectives.cpp
index 4bf012c1b11..d277ec9dd47 100644
--- a/clang/lib/Lex/PPDirectives.cpp
+++ b/clang/lib/Lex/PPDirectives.cpp
@@ -219,6 +219,7 @@ void Preprocessor::SkipExcludedConditionalBlock(SourceLocation IfTokenLoc,
}
memcpy(Directive, &DirectiveStr[0], IdLen);
Directive[IdLen] = 0;
+ FirstChar = Directive[0];
}
if (FirstChar == 'i' && Directive[1] == 'f') {
diff --git a/clang/test/Preprocessor/skipping_unclean.c b/clang/test/Preprocessor/skipping_unclean.c
new file mode 100644
index 00000000000..9efdd648b48
--- /dev/null
+++ b/clang/test/Preprocessor/skipping_unclean.c
@@ -0,0 +1,9 @@
+// RUN: clang -E %s | grep bark
+
+#if 0
+blah
+#\
+else
+bark
+#endif
+
OpenPOWER on IntegriCloud