diff options
author | John McCall <rjmccall@apple.com> | 2010-08-18 09:58:15 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2010-08-18 09:58:15 +0000 |
commit | 6aa03e6dc72623f04af415527bf580ec189ab7f6 (patch) | |
tree | 42f04d67175f6a841aeec10c7847ea7f1ade2d0b | |
parent | 94c3b561a4f24c5c44a1e2ee6f28f530e6a041ba (diff) |
Flesh out the test cases a little.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111359 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | test/SemaCXX/abstract.cpp | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/test/SemaCXX/abstract.cpp b/test/SemaCXX/abstract.cpp index e448f175b9..ad079c27c0 100644 --- a/test/SemaCXX/abstract.cpp +++ b/test/SemaCXX/abstract.cpp @@ -205,3 +205,47 @@ namespace test2 { void g(X2 parm11[2]); // expected-error {{array of abstract class type 'X2<N>'}} }; } + +namespace test3 { + struct A { // expected-note {{not complete until}} + A x; // expected-error {{field has incomplete type}} + virtual void abstract() = 0; + }; + + struct B { // expected-note {{not complete until}} + virtual void abstract() = 0; + B x; // expected-error {{field has incomplete type}} + }; + + struct C { + static C x; // expected-error {{abstract class}} + virtual void abstract() = 0; // expected-note {{pure virtual function}} + }; + + struct D { + virtual void abstract() = 0; // expected-note {{pure virtual function}} + static D x; // expected-error {{abstract class}} + }; +} + +namespace test4 { + template <class T> struct A { + A x; // expected-error {{abstract class}} + virtual void abstract() = 0; // expected-note {{pure virtual function}} + }; + + template <class T> struct B { + virtual void abstract() = 0; // expected-note {{pure virtual function}} + B x; // expected-error {{abstract class}} + }; + + template <class T> struct C { + static C x; // expected-error {{abstract class}} + virtual void abstract() = 0; // expected-note {{pure virtual function}} + }; + + template <class T> struct D { + virtual void abstract() = 0; // expected-note {{pure virtual function}} + static D x; // expected-error {{abstract class}} + }; +} |