[cfe-commits] r112392 - in /cfe/trunk: include/clang/Basic/DiagnosticLexKinds.td lib/Lex/Pragma.cpp
John McCall
rjmccall at apple.com
Sat Aug 28 18:09:54 PDT 2010
Author: rjmccall
Date: Sat Aug 28 20:09:54 2010
New Revision: 112392
URL: http://llvm.org/viewvc/llvm-project?rev=112392&view=rev
Log:
Complain if a __pragma isn't terminated.
Modified:
cfe/trunk/include/clang/Basic/DiagnosticLexKinds.td
cfe/trunk/lib/Lex/Pragma.cpp
Modified: cfe/trunk/include/clang/Basic/DiagnosticLexKinds.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticLexKinds.td?rev=112392&r1=112391&r2=112392&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/DiagnosticLexKinds.td (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticLexKinds.td Sat Aug 28 20:09:54 2010
@@ -51,6 +51,7 @@
def err_unterminated_block_comment : Error<"unterminated /* comment">;
def err_invalid_character_to_charify : Error<
"invalid argument to convert to character">;
+def err_unterminated___pragma : Error<"missing terminating ')' character">;
def err_conflict_marker : Error<"version control conflict marker in file">;
Modified: cfe/trunk/lib/Lex/Pragma.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Lex/Pragma.cpp?rev=112392&r1=112391&r2=112392&view=diff
==============================================================================
--- cfe/trunk/lib/Lex/Pragma.cpp (original)
+++ cfe/trunk/lib/Lex/Pragma.cpp Sat Aug 28 20:09:54 2010
@@ -202,6 +202,11 @@
Lex(Tok);
}
+ if (Tok.is(tok::eof)) {
+ Diag(PragmaLoc, diag::err_unterminated___pragma);
+ return;
+ }
+
// Build the pragma string.
std::string StrVal = " ";
for (llvm::SmallVector<Token, 32>::iterator I =
More information about the cfe-commits
mailing list