[cfe-commits] r45370 - in /cfe/trunk: Parse/ParseStmt.cpp test/Parser/expressions.m
Chris Lattner
sabre at nondot.org
Thu Dec 27 12:29:43 PST 2007
Author: lattner
Date: Thu Dec 27 14:29:42 2007
New Revision: 45370
URL: http://llvm.org/viewvc/llvm-project?rev=45370&view=rev
Log:
Fix a crash on a top-level objc string, patch by Nico Weber
Added:
cfe/trunk/test/Parser/expressions.m
Modified:
cfe/trunk/Parse/ParseStmt.cpp
Modified: cfe/trunk/Parse/ParseStmt.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Parse/ParseStmt.cpp?rev=45370&r1=45369&r2=45370&view=diff
==============================================================================
--- cfe/trunk/Parse/ParseStmt.cpp (original)
+++ cfe/trunk/Parse/ParseStmt.cpp Thu Dec 27 14:29:42 2007
@@ -87,9 +87,9 @@
case tok::at: // May be a @try or @throw statement
{
AtLoc = ConsumeToken(); // consume @
- if (Tok.getIdentifierInfo()->getObjCKeywordID() == tok::objc_try)
+ if (Tok.isObjCAtKeyword(tok::objc_try))
return ParseObjCTryStmt(AtLoc);
- else if (Tok.getIdentifierInfo()->getObjCKeywordID() == tok::objc_throw)
+ else if (Tok.isObjCAtKeyword(tok::objc_throw))
return ParseObjCThrowStmt(AtLoc);
ExprResult Res = ParseExpressionWithLeadingAt(AtLoc);
if (Res.isInvalid) {
Added: cfe/trunk/test/Parser/expressions.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Parser/expressions.m?rev=45370&view=auto
==============================================================================
--- cfe/trunk/test/Parser/expressions.m (added)
+++ cfe/trunk/test/Parser/expressions.m Thu Dec 27 14:29:42 2007
@@ -0,0 +1,6 @@
+// RUN: clang -parse-noop %s
+
+void test1() {
+ @"s"; // expected-warning {{expression result unused}}
+}
+
More information about the cfe-commits
mailing list