summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorNico Weber <nicolasweber@gmx.de>2015-12-29 23:17:27 +0000
committerNico Weber <nicolasweber@gmx.de>2015-12-29 23:17:27 +0000
commitde2310bddf6450f14748e0032f07eb767d58c9ca (patch)
treedea2348d00bd1c278ef234b7b66e1b60634aa027 /clang/lib
parent446cf25c2131bd75f0afe2392119a9fa1bb92884 (diff)
downloadbcm5719-llvm-de2310bddf6450f14748e0032f07eb767d58c9ca.tar.gz
bcm5719-llvm-de2310bddf6450f14748e0032f07eb767d58c9ca.zip
Emit a -Wmicrosoft warning when treating ^Z as EOF in MS mode.
llvm-svn: 256596
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Lex/Lexer.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/clang/lib/Lex/Lexer.cpp b/clang/lib/Lex/Lexer.cpp
index 4872dee8245..27b0feb4827 100644
--- a/clang/lib/Lex/Lexer.cpp
+++ b/clang/lib/Lex/Lexer.cpp
@@ -2960,8 +2960,11 @@ LexNextToken:
case 26: // DOS & CP/M EOF: "^Z".
// If we're in Microsoft extensions mode, treat this as end of file.
- if (LangOpts.MicrosoftExt)
+ if (LangOpts.MicrosoftExt) {
+ if (!isLexingRawMode())
+ Diag(CurPtr-1, diag::ext_ctrl_z_eof_microsoft);
return LexEndOfFile(Result, CurPtr-1);
+ }
// If Microsoft extensions are disabled, this is just random garbage.
Kind = tok::unknown;
OpenPOWER on IntegriCloud