Obj-C: Fix assert-on-invalid (PR27822)
Clang would assert when isObjCInstancetype() was called on a tok::annot_cxxscope token. llvm-svn: 271688
This commit is contained in:
parent
4c423773d8
commit
7c09cc67aa
|
@ -647,6 +647,8 @@ private:
|
|||
/// Should only be used in Objective-C language modes.
|
||||
bool isObjCInstancetype() {
|
||||
assert(getLangOpts().ObjC1);
|
||||
if (Tok.isAnnotation())
|
||||
return false;
|
||||
if (!Ident_instancetype)
|
||||
Ident_instancetype = PP.getIdentifierInfo("instancetype");
|
||||
return Tok.getIdentifierInfo() == Ident_instancetype;
|
||||
|
|
|
@ -214,3 +214,10 @@ void test_instancetype_inherited() {
|
|||
return 0;
|
||||
}
|
||||
@end
|
||||
|
||||
// PR27822
|
||||
@class NSString;
|
||||
namespace pr27822 { }
|
||||
@interface AXPlatformNodeCocoa
|
||||
+ (NSString*)nativeRoleFromAXRole:(pr27822::UndeclaredIdentifier)role; // expected-error {{expected a type}}
|
||||
@end
|
||||
|
|
Loading…
Reference in New Issue