summaryrefslogtreecommitdiffstats
path: root/clang
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2009-11-17 08:57:02 +0000
committerJohn McCall <rjmccall@apple.com>2009-11-17 08:57:02 +0000
commit7731b855dc868134fec9c0d7202fe447b2ab8bc5 (patch)
treef1f3a1bfb6a6f28ad0464e270804df5c94ad31ff /clang
parent8b9336bd988f97fdfcea81c1027a917874dd714a (diff)
downloadbcm5719-llvm-7731b855dc868134fec9c0d7202fe447b2ab8bc5.tar.gz
bcm5719-llvm-7731b855dc868134fec9c0d7202fe447b2ab8bc5.zip
Commit this random test case.
llvm-svn: 89068
Diffstat (limited to 'clang')
-rw-r--r--clang/test/CXX/dcl.dcl/basic.namespace/namespace.udecl/p1.cpp44
1 files changed, 44 insertions, 0 deletions
diff --git a/clang/test/CXX/dcl.dcl/basic.namespace/namespace.udecl/p1.cpp b/clang/test/CXX/dcl.dcl/basic.namespace/namespace.udecl/p1.cpp
new file mode 100644
index 00000000000..692ae8f4c12
--- /dev/null
+++ b/clang/test/CXX/dcl.dcl/basic.namespace/namespace.udecl/p1.cpp
@@ -0,0 +1,44 @@
+// RUN: clang-cc -fsyntax-only -verify %s
+
+// We have to avoid ADL for this test.
+
+template <unsigned N> class test {};
+
+class foo {};
+test<0> foo(foo); // expected-note {{candidate}}
+
+namespace A {
+ class foo { int x; };
+ test<1> foo(class foo);
+
+ namespace B {
+ test<2> foo(class ::foo); // expected-note {{candidate}}
+
+ void test0() {
+ using ::foo;
+
+ class foo a;
+ test<0> _ = (foo)(a);
+ }
+
+ void test1() {
+ using A::foo;
+
+ class foo a;
+ test<1> _ = (foo)(a);
+ };
+
+ void test2() {
+ class ::foo a;
+
+ // Argument-dependent lookup is ambiguous between B:: and ::.
+ test<0> _0 = foo(a); // expected-error {{call to 'foo' is ambiguous}}
+
+ // But basic unqualified lookup is not.
+ test<2> _1 = (foo)(a);
+
+ class A::foo b;
+ test<2> _2 = (foo)(b); // expected-error {{incompatible type passing}}
+ }
+ }
+}
OpenPOWER on IntegriCloud