Objective-C keywords are not always identifiers. Some are also C++ keywords

llvm-svn: 60373
This commit is contained in:
Douglas Gregor 2008-12-01 21:46:47 +00:00
parent dce30aa0f9
commit 90abb6dead
2 changed files with 5 additions and 4 deletions

View File

@ -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.

View File

@ -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