diff options
-rw-r--r-- | lib/Lex/Lexer.cpp | 5 | ||||
-rw-r--r-- | test/Parser/objc-try-catch-1.m | 4 |
2 files changed, 5 insertions, 4 deletions
diff --git a/lib/Lex/Lexer.cpp b/lib/Lex/Lexer.cpp index d72c319d97..f85cfd9f0f 100644 --- a/lib/Lex/Lexer.cpp +++ b/lib/Lex/Lexer.cpp @@ -41,8 +41,9 @@ static void InitCharacterInfo(); /// isObjCAtKeyword - Return true if we have an ObjC keyword identifier. bool Token::isObjCAtKeyword(tok::ObjCKeywordKind objcKey) const { - return is(tok::identifier) && - getIdentifierInfo()->getObjCKeywordID() == objcKey; + if (IdentifierInfo *II = getIdentifierInfo()) + return II->getObjCKeywordID() == objcKey; + return false; } /// getObjCKeywordID - Return the ObjC keyword kind. diff --git a/test/Parser/objc-try-catch-1.m b/test/Parser/objc-try-catch-1.m index 072c4609eb..d8264fabbe 100644 --- a/test/Parser/objc-try-catch-1.m +++ b/test/Parser/objc-try-catch-1.m @@ -1,5 +1,5 @@ -// RUN: clang -fsyntax-only -verify %s - +// RUN: clang -fsyntax-only -verify %s && +// RUN: clang -fsyntax-only -verify -x objective-c++ %s void * proc(); @interface NSConstantString |