From: John McCall Date: Wed, 18 Aug 2010 09:58:15 +0000 (+0000) Subject: Flesh out the test cases a little. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6aa03e6dc72623f04af415527bf580ec189ab7f6;p=clang Flesh out the test cases a little. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111359 91177308-0d34-0410-b5e6-96231b3b80d8 --- 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'}} }; } + +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 struct A { + A x; // expected-error {{abstract class}} + virtual void abstract() = 0; // expected-note {{pure virtual function}} + }; + + template struct B { + virtual void abstract() = 0; // expected-note {{pure virtual function}} + B x; // expected-error {{abstract class}} + }; + + template struct C { + static C x; // expected-error {{abstract class}} + virtual void abstract() = 0; // expected-note {{pure virtual function}} + }; + + template struct D { + virtual void abstract() = 0; // expected-note {{pure virtual function}} + static D x; // expected-error {{abstract class}} + }; +}