forked from OSchip/llvm-project
Objective-C++: The global namespace is an associated namespace of an
Objective-C pointer type. Fixes <rdar://problem/9142559>. llvm-svn: 129339
This commit is contained in:
parent
fbc5a4004c
commit
8e93666a71
|
@ -1963,10 +1963,13 @@ addAssociatedClassesAndNamespaces(AssociatedLookup &Result, QualType Ty) {
|
|||
case Type::Complex:
|
||||
break;
|
||||
|
||||
// These are ignored by ADL.
|
||||
// If T is an Objective-C object or interface type, or a pointer to an
|
||||
// object or interface type, the associated namespace is the global
|
||||
// namespace.
|
||||
case Type::ObjCObject:
|
||||
case Type::ObjCInterface:
|
||||
case Type::ObjCObjectPointer:
|
||||
Result.Namespaces.insert(Result.S.Context.getTranslationUnitDecl());
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
// RUN: %clang_cc1 -fsyntax-only -verify %s
|
||||
|
||||
// <rdar://problem/9142559>: For the purposes of Argument-Dependent
|
||||
// Lookup, Objective-C classes are considered to be in the global
|
||||
// namespace.
|
||||
|
||||
@interface NSFoo
|
||||
@end
|
||||
|
||||
template<typename T>
|
||||
void f(T t) {
|
||||
g(t);
|
||||
}
|
||||
|
||||
void g(NSFoo*);
|
||||
|
||||
void test(NSFoo *foo) {
|
||||
f(foo);
|
||||
}
|
Loading…
Reference in New Issue