IDNS_Ordinary = 0x8,
IDNS_ObjCProtocol = 0x10,
IDNS_ObjCImplementation = 0x20,
- IDNS_ObjCCategoryImpl = 0x40,
+ IDNS_ObjCCategoryName = 0x40,
IDNS_OrdinaryFriend = 0x80,
IDNS_TagFriend = 0x100,
IDNS_Using = 0x200
case NonTypeTemplateParm:
case ObjCMethod:
case ObjCContainer:
- case ObjCCategory:
case ObjCInterface:
case ObjCProperty:
case ObjCCompatibleAlias:
case ObjCImplementation:
return IDNS_ObjCImplementation;
+ case ObjCCategory:
case ObjCCategoryImpl:
- return IDNS_ObjCCategoryImpl;
+ return IDNS_ObjCCategoryName;
case Field:
case ObjCAtDefsField:
/// Look up the name of an Objective-C protocol.
LookupObjCProtocolName,
/// Look up the name of an Objective-C implementation
- LookupObjCImplementationName,
- /// Look up the name of an Objective-C category implementation
- LookupObjCCategoryImplName
+ LookupObjCImplementationName
};
enum RedeclarationKind {
case Sema::LookupUsingDeclName:
case Sema::LookupObjCProtocolName:
case Sema::LookupObjCImplementationName:
- case Sema::LookupObjCCategoryImplName:
return D->isInIdentifierNamespace(IDNS);
case Sema::LookupOperatorName:
bool EnteringContext = false);
ObjCProtocolDecl *LookupProtocol(IdentifierInfo *II);
- ObjCCategoryImplDecl *LookupObjCCategoryImpl(IdentifierInfo *II);
void LookupOverloadedOperatorName(OverloadedOperatorKind Op, Scope *S,
QualType T1, QualType T2,
case Sema::LookupObjCImplementationName:
IDNS = Decl::IDNS_ObjCImplementation;
break;
-
- case Sema::LookupObjCCategoryImplName:
- IDNS = Decl::IDNS_ObjCCategoryImpl;
- break;
}
return IDNS;
}
IDNS = Decl::IDNS_ObjCImplementation;
break;
- case Sema::LookupObjCCategoryImplName:
- IDNS = Decl::IDNS_ObjCCategoryImpl;
- break;
}
// Scan up the scope chain looking for a decl that matches this
case LookupNamespaceName:
case LookupObjCProtocolName:
case LookupObjCImplementationName:
- case LookupObjCCategoryImplName:
// These lookups will never find a member in a C++ class (or base class).
return false;
return cast_or_null<ObjCProtocolDecl>(D);
}
-/// \brief Find the Objective-C category implementation with the given
-/// name, if any.
-ObjCCategoryImplDecl *Sema::LookupObjCCategoryImpl(IdentifierInfo *II) {
- Decl *D = LookupSingleName(TUScope, II, LookupObjCCategoryImplName);
- return cast_or_null<ObjCCategoryImplDecl>(D);
-}
-
void Sema::LookupOverloadedOperatorName(OverloadedOperatorKind Op, Scope *S,
QualType T1, QualType T2,
FunctionSet &Functions) {
// CHECK-CCA: {TypedText self}
// CHECK-CCA: TypedefDecl:{TypedText Class}
// CHECK-CCA: ObjCInterfaceDecl:{TypedText Foo}
-// CHECK-CCA: ObjCCategoryDecl:{TypedText FooTestCategory}
// CHECK-CCA: FunctionDecl:{TypedText func}{LeftParen (}{RightParen )}
// CHECK-CCA: TypedefDecl:{TypedText id}
// CHECK-CCA: ObjCInterfaceDecl:{TypedText MyClass}
--- /dev/null
+// RUN: clang-cc -fsyntax-only -verify %s
+
+@interface NSObject @end
+
+@interface NSObject (NSScriptClassDescription)
+@end
+
+void f() {
+ NSScriptClassDescription *f; // expected-error {{use of undeclared identifier 'NSScriptClassDescription'}}
+}