diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-06-28 07:51:56 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-06-28 07:51:56 +0000 |
commit | 608c0b65d78531d1713a02f34a9b876deefb4943 (patch) | |
tree | bb5896cb8c9ac22d95f5d2371956fc27c6a14b18 /clang/lib/Lex/Lexer.cpp | |
parent | 420a4ed6528b1422ae624fbbc501a6cd2d3dabb5 (diff) | |
download | llvm-608c0b65d78531d1713a02f34a9b876deefb4943.zip llvm-608c0b65d78531d1713a02f34a9b876deefb4943.tar.gz llvm-608c0b65d78531d1713a02f34a9b876deefb4943.tar.bz2 |
Add warning flag -Winvalid-pp-token for preprocessing-tokens which have
undefined behaviour, and move the diagnostic for '' from an Error into
an ExtWarn in this group. This is important for some users of the preprocessor,
and is necessary for gcc compatibility.
llvm-svn: 159335
Diffstat (limited to 'clang/lib/Lex/Lexer.cpp')
-rw-r--r-- | clang/lib/Lex/Lexer.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/clang/lib/Lex/Lexer.cpp b/clang/lib/Lex/Lexer.cpp index dedf320..52a094a 100644 --- a/clang/lib/Lex/Lexer.cpp +++ b/clang/lib/Lex/Lexer.cpp @@ -1649,7 +1649,7 @@ void Lexer::LexStringLiteral(Token &Result, const char *CurPtr, if (C == '\n' || C == '\r' || // Newline. (C == 0 && CurPtr-1 == BufferEnd)) { // End of file. if (!isLexingRawMode() && !LangOpts.AsmPreprocessor) - Diag(BufferPtr, diag::warn_unterminated_string); + Diag(BufferPtr, diag::ext_unterminated_string); FormTokenWithChars(Result, CurPtr-1, tok::unknown); return; } @@ -1807,7 +1807,7 @@ void Lexer::LexCharConstant(Token &Result, const char *CurPtr, char C = getAndAdvanceChar(CurPtr, Result); if (C == '\'') { if (!isLexingRawMode() && !LangOpts.AsmPreprocessor) - Diag(BufferPtr, diag::err_empty_character); + Diag(BufferPtr, diag::ext_empty_character); FormTokenWithChars(Result, CurPtr, tok::unknown); return; } @@ -1821,7 +1821,7 @@ void Lexer::LexCharConstant(Token &Result, const char *CurPtr, } else if (C == '\n' || C == '\r' || // Newline. (C == 0 && CurPtr-1 == BufferEnd)) { // End of file. if (!isLexingRawMode() && !LangOpts.AsmPreprocessor) - Diag(BufferPtr, diag::warn_unterminated_char); + Diag(BufferPtr, diag::ext_unterminated_char); FormTokenWithChars(Result, CurPtr-1, tok::unknown); return; } else if (C == 0) { |