summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--clang/Parse/ParseStmt.cpp4
-rw-r--r--clang/test/Parser/expressions.m6
2 files changed, 8 insertions, 2 deletions
diff --git a/clang/Parse/ParseStmt.cpp b/clang/Parse/ParseStmt.cpp
index 063735196ee..80d0b9ece4e 100644
--- a/clang/Parse/ParseStmt.cpp
+++ b/clang/Parse/ParseStmt.cpp
@@ -87,9 +87,9 @@ Parser::StmtResult Parser::ParseStatementOrDeclaration(bool OnlyStatement) {
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) {
diff --git a/clang/test/Parser/expressions.m b/clang/test/Parser/expressions.m
new file mode 100644
index 00000000000..8e314aca6f7
--- /dev/null
+++ b/clang/test/Parser/expressions.m
@@ -0,0 +1,6 @@
+// RUN: clang -parse-noop %s
+
+void test1() {
+ @"s"; // expected-warning {{expression result unused}}
+}
+
OpenPOWER on IntegriCloud