Objective-C pointer type. Fixes <rdar://problem/
9142559>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129339
91177308-0d34-0410-b5e6-
96231b3b80d8
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;
}
--- /dev/null
+// 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);
+}