add a warning for this crazy case, as suggested by Eli.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68524 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/tools/clang-cc/clang-cc.cpp b/tools/clang-cc/clang-cc.cpp
index 5a5ffc3..d257c43 100644
--- a/tools/clang-cc/clang-cc.cpp
+++ b/tools/clang-cc/clang-cc.cpp
@@ -972,7 +972,13 @@
// Per GCC -D semantics, the macro ends at \n if it exists.
const char *End = strpbrk(Equal, "\n\r");
- if (End == 0) End = Equal+strlen(Equal);
+ if (End) {
+ fprintf(stderr, "warning: macro '%s' contains embeded newline, text "
+ "after the newline is ignored.\n",
+ std::string(Macro, Equal).c_str());
+ } else {
+ End = Equal+strlen(Equal);
+ }
Buf.insert(Buf.end(), Equal+1, End);
} else {