diff options
-rw-r--r-- | include/clang/AST/DeclBase.h | 2 | ||||
-rw-r--r-- | lib/AST/DeclBase.cpp | 4 | ||||
-rw-r--r-- | lib/Sema/Sema.h | 6 | ||||
-rw-r--r-- | lib/Sema/SemaLookup.cpp | 15 | ||||
-rw-r--r-- | test/Index/complete-objc-message.m | 1 | ||||
-rw-r--r-- | test/SemaObjCXX/category-lookup.mm | 10 |
6 files changed, 14 insertions, 24 deletions
diff --git a/include/clang/AST/DeclBase.h b/include/clang/AST/DeclBase.h index 00103ce0f9..17f379dace 100644 --- a/include/clang/AST/DeclBase.h +++ b/include/clang/AST/DeclBase.h @@ -91,7 +91,7 @@ public: IDNS_Ordinary = 0x8, IDNS_ObjCProtocol = 0x10, IDNS_ObjCImplementation = 0x20, - IDNS_ObjCCategoryImpl = 0x40, + IDNS_ObjCCategoryName = 0x40, IDNS_OrdinaryFriend = 0x80, IDNS_TagFriend = 0x100, IDNS_Using = 0x200 diff --git a/lib/AST/DeclBase.cpp b/lib/AST/DeclBase.cpp index 2022b4a28c..3afb4e44f3 100644 --- a/lib/AST/DeclBase.cpp +++ b/lib/AST/DeclBase.cpp @@ -198,7 +198,6 @@ unsigned Decl::getIdentifierNamespaceForKind(Kind DeclKind) { case NonTypeTemplateParm: case ObjCMethod: case ObjCContainer: - case ObjCCategory: case ObjCInterface: case ObjCProperty: case ObjCCompatibleAlias: @@ -220,8 +219,9 @@ unsigned Decl::getIdentifierNamespaceForKind(Kind DeclKind) { case ObjCImplementation: return IDNS_ObjCImplementation; + case ObjCCategory: case ObjCCategoryImpl: - return IDNS_ObjCCategoryImpl; + return IDNS_ObjCCategoryName; case Field: case ObjCAtDefsField: diff --git a/lib/Sema/Sema.h b/lib/Sema/Sema.h index 7b030cbe93..88de8da2b3 100644 --- a/lib/Sema/Sema.h +++ b/lib/Sema/Sema.h @@ -1136,9 +1136,7 @@ public: /// 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 { @@ -1162,7 +1160,6 @@ public: case Sema::LookupUsingDeclName: case Sema::LookupObjCProtocolName: case Sema::LookupObjCImplementationName: - case Sema::LookupObjCCategoryImplName: return D->isInIdentifierNamespace(IDNS); case Sema::LookupOperatorName: @@ -1198,7 +1195,6 @@ public: bool EnteringContext = false); ObjCProtocolDecl *LookupProtocol(IdentifierInfo *II); - ObjCCategoryImplDecl *LookupObjCCategoryImpl(IdentifierInfo *II); void LookupOverloadedOperatorName(OverloadedOperatorKind Op, Scope *S, QualType T1, QualType T2, diff --git a/lib/Sema/SemaLookup.cpp b/lib/Sema/SemaLookup.cpp index 66c846b078..7428e941d5 100644 --- a/lib/Sema/SemaLookup.cpp +++ b/lib/Sema/SemaLookup.cpp @@ -234,10 +234,6 @@ getIdentifierNamespacesFromLookupNameKind(Sema::LookupNameKind NameKind, case Sema::LookupObjCImplementationName: IDNS = Decl::IDNS_ObjCImplementation; break; - - case Sema::LookupObjCCategoryImplName: - IDNS = Decl::IDNS_ObjCCategoryImpl; - break; } return IDNS; } @@ -640,9 +636,6 @@ bool Sema::LookupName(LookupResult &R, Scope *S, bool AllowBuiltinCreation) { 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 @@ -942,7 +935,6 @@ bool Sema::LookupQualifiedName(LookupResult &R, DeclContext *LookupCtx) { case LookupNamespaceName: case LookupObjCProtocolName: case LookupObjCImplementationName: - case LookupObjCCategoryImplName: // These lookups will never find a member in a C++ class (or base class). return false; @@ -1592,13 +1584,6 @@ ObjCProtocolDecl *Sema::LookupProtocol(IdentifierInfo *II) { 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) { diff --git a/test/Index/complete-objc-message.m b/test/Index/complete-objc-message.m index f5827bbea0..1c03095e2a 100644 --- a/test/Index/complete-objc-message.m +++ b/test/Index/complete-objc-message.m @@ -137,7 +137,6 @@ void test_overload(Overload *ovl) { // 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} diff --git a/test/SemaObjCXX/category-lookup.mm b/test/SemaObjCXX/category-lookup.mm new file mode 100644 index 0000000000..3335d20022 --- /dev/null +++ b/test/SemaObjCXX/category-lookup.mm @@ -0,0 +1,10 @@ +// 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'}} +} |