diff options
| author | Chris Lattner <sabre@nondot.org> | 2006-07-11 05:52:53 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2006-07-11 05:52:53 +0000 |
| commit | 041bef8b3224b6fc3aa36eb243ac43fbb5d35054 (patch) | |
| tree | 2ad2f6251ea50c792f5377d151fa099d55ca6d99 /clang/Lex/Lexer.cpp | |
| parent | 678c880a69c398024e08cb2cbb55c04dfadbd07a (diff) | |
| download | bcm5719-llvm-041bef8b3224b6fc3aa36eb243ac43fbb5d35054.tar.gz bcm5719-llvm-041bef8b3224b6fc3aa36eb243ac43fbb5d35054.zip | |
The lexer should not warn about stray characters, it should just return
tok::unknown tokens. This fixes test/Lexer/unknown-char.c
llvm-svn: 38703
Diffstat (limited to 'clang/Lex/Lexer.cpp')
| -rw-r--r-- | clang/Lex/Lexer.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/clang/Lex/Lexer.cpp b/clang/Lex/Lexer.cpp index 7b4cbd7962d..cc45e1224a6 100644 --- a/clang/Lex/Lexer.cpp +++ b/clang/Lex/Lexer.cpp @@ -1394,9 +1394,8 @@ LexNextToken: return LexIdentifier(Result, CurPtr); } - if (!LexingRawMode) Diag(CurPtr-1, diag::err_stray_character); - BufferPtr = CurPtr; - goto LexNextToken; // GCC isn't tail call eliminating. + Result.SetKind(tok::unknown); + break; } // Notify MIOpt that we read a non-whitespace/non-comment token. |

