summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-07-11 05:52:53 +0000
committerChris Lattner <sabre@nondot.org>2006-07-11 05:52:53 +0000
commit041bef8b3224b6fc3aa36eb243ac43fbb5d35054 (patch)
tree2ad2f6251ea50c792f5377d151fa099d55ca6d99
parent678c880a69c398024e08cb2cbb55c04dfadbd07a (diff)
downloadbcm5719-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
-rw-r--r--clang/Lex/Lexer.cpp5
-rw-r--r--clang/include/clang/Basic/DiagnosticKinds.def2
2 files changed, 2 insertions, 5 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.
diff --git a/clang/include/clang/Basic/DiagnosticKinds.def b/clang/include/clang/Basic/DiagnosticKinds.def
index e0519f5d10c..bd0202ac8c1 100644
--- a/clang/include/clang/Basic/DiagnosticKinds.def
+++ b/clang/include/clang/Basic/DiagnosticKinds.def
@@ -71,8 +71,6 @@ DIAG(err_empty_character, ERROR,
"empty character constant")
DIAG(err_unterminated_block_comment, ERROR,
"unterminated /* comment")
-DIAG(err_stray_character, ERROR,
- "stray character in program")
//===----------------------------------------------------------------------===//
// Preprocessor Diagnostics
OpenPOWER on IntegriCloud