diff options
Diffstat (limited to 'test/SemaCXX/nested-name-spec.cpp')
-rw-r--r-- | test/SemaCXX/nested-name-spec.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/test/SemaCXX/nested-name-spec.cpp b/test/SemaCXX/nested-name-spec.cpp index b48207345a..0c160075bf 100644 --- a/test/SemaCXX/nested-name-spec.cpp +++ b/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 |