diff options
| author | Nico Weber <nicolasweber@gmx.de> | 2015-12-29 23:17:27 +0000 |
|---|---|---|
| committer | Nico Weber <nicolasweber@gmx.de> | 2015-12-29 23:17:27 +0000 |
| commit | de2310bddf6450f14748e0032f07eb767d58c9ca (patch) | |
| tree | dea2348d00bd1c278ef234b7b66e1b60634aa027 /clang/lib | |
| parent | 446cf25c2131bd75f0afe2392119a9fa1bb92884 (diff) | |
| download | bcm5719-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.cpp | 5 |
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; |

