diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-03-11 23:52:16 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-03-11 23:52:16 +0000 |
commit | 04e9a03e6f2b69523fcd4d911a4d714f33f01ec8 (patch) | |
tree | 0d549744c40217204f772db04f393ff1f0e228f8 /clang/test/SemaCXX/nested-name-spec.cpp | |
parent | f9351cff98dfaebd5f2a42a8d2c4e65a5682aac4 (diff) | |
download | bcm5719-llvm-04e9a03e6f2b69523fcd4d911a4d714f33f01ec8.tar.gz bcm5719-llvm-04e9a03e6f2b69523fcd4d911a4d714f33f01ec8.zip |
Fix various problems with matching out-of-line definitions of static
class members to the corresponding in-class declaration.
Diagnose the erroneous use of 'static' on out-of-line definitions of
class members.
llvm-svn: 66740
Diffstat (limited to 'clang/test/SemaCXX/nested-name-spec.cpp')
-rw-r--r-- | clang/test/SemaCXX/nested-name-spec.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/nested-name-spec.cpp b/clang/test/SemaCXX/nested-name-spec.cpp index f75b279a449..eaca56c7252 100644 --- a/clang/test/SemaCXX/nested-name-spec.cpp +++ b/clang/test/SemaCXX/nested-name-spec.cpp @@ -2,6 +2,11 @@ namespace A { struct C { static int cx; + + static int cx2; + + static int Ag1(); + static int Ag2(); }; int ax; void Af(); @@ -11,6 +16,15 @@ A:: ; // expected-error {{expected unqualified-id}} ::A::ax::undef ex3; // expected-error {{expected a class or namespace}} expected-error {{invalid token after top level declarator}} A::undef1::undef2 ex4; // expected-error {{no member named 'undef1'}} expected-error {{invalid token after top level declarator}} +int A::C::Ag1() { return 0; } + +static int A::C::Ag2() { return 0; } // expected-error{{'static' can not be specified on an out-of-line static member}} + +int A::C::cx = 17; + + +static int A::C::cx2 = 17; // expected-error{{'static' can not be specified on an out-of-line static member}} + class C2 { void m(); // expected-note{{member declaration nearly matches}} |