Fix a crash on a top-level objc string, patch by Nico Weber
llvm-svn: 45370
This commit is contained in:
parent
05568bbd98
commit
11221033be
|
@ -87,9 +87,9 @@ Parser::StmtResult Parser::ParseStatementOrDeclaration(bool OnlyStatement) {
|
||||||
case tok::at: // May be a @try or @throw statement
|
case tok::at: // May be a @try or @throw statement
|
||||||
{
|
{
|
||||||
AtLoc = ConsumeToken(); // consume @
|
AtLoc = ConsumeToken(); // consume @
|
||||||
if (Tok.getIdentifierInfo()->getObjCKeywordID() == tok::objc_try)
|
if (Tok.isObjCAtKeyword(tok::objc_try))
|
||||||
return ParseObjCTryStmt(AtLoc);
|
return ParseObjCTryStmt(AtLoc);
|
||||||
else if (Tok.getIdentifierInfo()->getObjCKeywordID() == tok::objc_throw)
|
else if (Tok.isObjCAtKeyword(tok::objc_throw))
|
||||||
return ParseObjCThrowStmt(AtLoc);
|
return ParseObjCThrowStmt(AtLoc);
|
||||||
ExprResult Res = ParseExpressionWithLeadingAt(AtLoc);
|
ExprResult Res = ParseExpressionWithLeadingAt(AtLoc);
|
||||||
if (Res.isInvalid) {
|
if (Res.isInvalid) {
|
||||||
|
|
|
@ -0,0 +1,6 @@
|
||||||
|
// RUN: clang -parse-noop %s
|
||||||
|
|
||||||
|
void test1() {
|
||||||
|
@"s"; // expected-warning {{expression result unused}}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue