summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/SemaCXX/nested-name-spec.cpp25
-rw-r--r--clang/test/SemaCXX/qualified-id-lookup.cpp1
2 files changed, 25 insertions, 1 deletions
diff --git a/clang/test/SemaCXX/nested-name-spec.cpp b/clang/test/SemaCXX/nested-name-spec.cpp
index b48207345a5..0c160075bf3 100644
--- a/clang/test/SemaCXX/nested-name-spec.cpp
+++ b/clang/test/SemaCXX/nested-name-spec.cpp
@@ -123,3 +123,28 @@ Operators Operators::operator+(const Operators&) const {
Operators::operator bool() {
return true;
}
+
+namespace A {
+ void g(int&); // expected-note{{member declaration nearly matches}}
+}
+
+void A::f() {} // expected-error{{out-of-line definition does not match any declaration in 'A'}}
+
+void A::g(const int&) { } // expected-error{{out-of-line definition does not match any declaration in 'A'}}
+
+struct Struct { };
+
+void Struct::f() { } // expected-error{{out-of-line definition does not match any declaration in 'Struct'}}
+
+void global_func(int);
+void global_func2(int);
+
+namespace N {
+ void ::global_func(int) { } // expected-error{{definition or redeclaration of 'global_func' cannot name the global scope}}
+
+ void f();
+ // FIXME: if we move this to a separate definition of N, things break!
+}
+void ::global_func2(int) { } // expected-error{{definition or redeclaration of 'global_func2' cannot name the global scope}}
+
+void N::f() { } // okay
diff --git a/clang/test/SemaCXX/qualified-id-lookup.cpp b/clang/test/SemaCXX/qualified-id-lookup.cpp
index e5721e00ee3..2783710fcbd 100644
--- a/clang/test/SemaCXX/qualified-id-lookup.cpp
+++ b/clang/test/SemaCXX/qualified-id-lookup.cpp
@@ -109,4 +109,3 @@ struct Undef { // expected-note{{definition of 'struct Undef' is not complete un
int Undef::f() {
return sizeof(Undef);
}
-
OpenPOWER on IntegriCloud