diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2014-03-17 21:46:03 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2014-03-17 21:46:03 +0000 |
commit | baf3ca5c0101cd4b2d26a0a7da013edb55b3ab5d (patch) | |
tree | 15e6a192fda263b0355fe4b5df8023c1139f6e6c /clang/test | |
parent | ba419ce21d0cc6083e44cc5555158750d876c943 (diff) | |
download | bcm5719-llvm-baf3ca5c0101cd4b2d26a0a7da013edb55b3ab5d.tar.gz bcm5719-llvm-baf3ca5c0101cd4b2d26a0a7da013edb55b3ab5d.zip |
Don't fold together the name lookup entries for two declarations if they are
declared in different namespaces in the same inline namespace set.
llvm-svn: 204082
Diffstat (limited to 'clang/test')
-rw-r--r-- | clang/test/CXX/basic/basic.lookup/basic.lookup.qual/namespace.qual/p2.cpp | 11 | ||||
-rw-r--r-- | clang/test/CXX/dcl.decl/dcl.meaning/p1-0x.cpp | 23 |
2 files changed, 23 insertions, 11 deletions
diff --git a/clang/test/CXX/basic/basic.lookup/basic.lookup.qual/namespace.qual/p2.cpp b/clang/test/CXX/basic/basic.lookup/basic.lookup.qual/namespace.qual/p2.cpp index 30393961b3f..7918e9f861e 100644 --- a/clang/test/CXX/basic/basic.lookup/basic.lookup.qual/namespace.qual/p2.cpp +++ b/clang/test/CXX/basic/basic.lookup/basic.lookup.qual/namespace.qual/p2.cpp @@ -63,3 +63,14 @@ void test3() { Numbers2::f(f); Numbers2::g(f); // expected-error {{no viable conversion from 'float' to 'Numbers::Number'}} } + +namespace inline_ns { + int x; // expected-note 2{{found}} + inline namespace A { // expected-warning {{C++11}} + int x; // expected-note 2{{found}} + int y; // expected-note 2{{found}} + } + int y; // expected-note 2{{found}} + int k1 = x + y; // expected-error 2{{ambiguous}} + int k2 = inline_ns::x + inline_ns::y; // expected-error 2{{ambiguous}} +} diff --git a/clang/test/CXX/dcl.decl/dcl.meaning/p1-0x.cpp b/clang/test/CXX/dcl.decl/dcl.meaning/p1-0x.cpp index 13810769743..41ff3e28237 100644 --- a/clang/test/CXX/dcl.decl/dcl.meaning/p1-0x.cpp +++ b/clang/test/CXX/dcl.decl/dcl.meaning/p1-0x.cpp @@ -30,9 +30,12 @@ namespace inline_namespaces { inline namespace M { void f(); // expected-note {{possible target}} void g(); - extern int m, n; - struct S; struct T; - enum E : int; enum F : int; + extern int m; // expected-note {{candidate}} + extern int n; + struct S; // expected-note {{candidate}} + struct T; + enum E : int; // expected-note {{candidate}} + enum F : int; template<typename T> void ft(); // expected-note {{here}} template<typename T> void gt(); // expected-note {{here}} template<typename T> extern int mt; // expected-note {{here}} expected-warning {{extension}} @@ -44,16 +47,14 @@ namespace inline_namespaces { // When named by unqualified-id, we do *not* look in the inline namespace // set. void f() {} // expected-note {{possible target}} - int m; - struct S {}; - enum E : int {}; + int m; // expected-note {{candidate}} + struct S {}; // expected-note {{candidate}} + enum E : int {}; // expected-note {{candidate}} static_assert(&f != &M::f, ""); // expected-error {{reference to overloaded function could not be resolved}} - static_assert(&m != &M::m, ""); - typedef S X; // expected-note {{previous}} - typedef M::S X; // expected-error {{different type}} - typedef E Y; // expected-note {{previous}} - typedef M::E Y; // expected-error {{different type}} + static_assert(&m != &M::m, ""); // expected-error {{ambiguous}} + typedef S X; // expected-error {{ambiguous}} + typedef E Y; // expected-error {{ambiguous}} // When named by (unqualified) template-id, we do look in the inline // namespace set. See [namespace.def]p8, [temp.explicit]p3, |