diff options
author | rdivacky <rdivacky@FreeBSD.org> | 2010-02-16 09:31:36 +0000 |
---|---|---|
committer | rdivacky <rdivacky@FreeBSD.org> | 2010-02-16 09:31:36 +0000 |
commit | fd035e6496665b1f1197868e21cb0a4594e8db6e (patch) | |
tree | 53010172e19c77ea447bcd89e117cda052ab52e0 /test/SemaCXX/using-decl-1.cpp | |
parent | 2fce988e86bc01829142e4362d4eff1af0925147 (diff) | |
download | FreeBSD-src-fd035e6496665b1f1197868e21cb0a4594e8db6e.zip FreeBSD-src-fd035e6496665b1f1197868e21cb0a4594e8db6e.tar.gz |
Update clang to r96341.
Diffstat (limited to 'test/SemaCXX/using-decl-1.cpp')
-rw-r--r-- | test/SemaCXX/using-decl-1.cpp | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/test/SemaCXX/using-decl-1.cpp b/test/SemaCXX/using-decl-1.cpp index e8a7d70..30c4cfd 100644 --- a/test/SemaCXX/using-decl-1.cpp +++ b/test/SemaCXX/using-decl-1.cpp @@ -60,3 +60,38 @@ namespace P { g(f); } } + +// Make sure that ADL can find names brought in by using decls. +namespace test0 { + namespace ns { + class Foo {}; + + namespace inner { + void foo(char *); // expected-note {{no known conversion}} + } + + using inner::foo; + } + + void test(ns::Foo *p) { + foo(*p); // expected-error {{no matching function for call to 'foo'}} + } +} + +// Redeclarations! +namespace test1 { + namespace ns0 { struct Foo {}; } + namespace A { void foo(ns0::Foo *p, int y, int z); } + namespace ns2 { using A::foo; } + namespace ns1 { struct Bar : ns0::Foo {}; } + namespace A { void foo(ns0::Foo *p, int y, int z = 0); } // expected-note {{candidate}} + namespace ns1 { using A::foo; } + namespace ns2 { struct Baz : ns1::Bar {}; } + namespace A { void foo(ns0::Foo *p, int y = 0, int z); } + + void test(ns2::Baz *p) { + foo(p, 0, 0); // okay! + foo(p, 0); // should be fine! + foo(p); // expected-error {{no matching function}} + } +} |