aboutsummaryrefslogtreecommitdiff
path: root/test/SemaCXX/using-directive.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/SemaCXX/using-directive.cpp')
-rw-r--r--test/SemaCXX/using-directive.cpp37
1 files changed, 36 insertions, 1 deletions
diff --git a/test/SemaCXX/using-directive.cpp b/test/SemaCXX/using-directive.cpp
index e258586491..d861f50f79 100644
--- a/test/SemaCXX/using-directive.cpp
+++ b/test/SemaCXX/using-directive.cpp
@@ -62,7 +62,7 @@ struct K2 k2; // expected-error{{reference to 'K2' is ambiguous}} \
//K2 k3;
-class X {
+class X { // expected-note{{candidate found by name lookup is 'X'}}
// FIXME: produce a suitable error message for this
using namespace A; // expected-error{{expected unqualified-id}}
};
@@ -71,3 +71,38 @@ namespace N {
struct K2;
struct K2 { };
}
+
+namespace Ni {
+ int i(); // expected-note{{candidate found by name lookup is 'Ni::i'}}
+}
+
+namespace NiTest {
+ using namespace A;
+ using namespace Ni;
+
+ int test() {
+ return i; // expected-error{{reference to 'i' is ambiguous}}
+ }
+}
+
+namespace OneTag {
+ struct X; // expected-note{{candidate found by name lookup is 'OneTag::X'}}
+}
+
+namespace OneFunction {
+ void X(); // expected-note{{candidate found by name lookup is 'OneFunction::X'}}
+}
+
+namespace TwoTag {
+ struct X; // expected-note{{candidate found by name lookup is 'TwoTag::X'}}
+}
+
+namespace FuncHidesTagAmbiguity {
+ using namespace OneTag;
+ using namespace OneFunction;
+ using namespace TwoTag;
+
+ void test() {
+ (void)X(); // expected-error{{reference to 'X' is ambiguous}}
+ }
+}