]> granicus.if.org Git - clang/commitdiff
Flesh out the test cases a little.
authorJohn McCall <rjmccall@apple.com>
Wed, 18 Aug 2010 09:58:15 +0000 (09:58 +0000)
committerJohn McCall <rjmccall@apple.com>
Wed, 18 Aug 2010 09:58:15 +0000 (09:58 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111359 91177308-0d34-0410-b5e6-96231b3b80d8

test/SemaCXX/abstract.cpp

index e448f175b90a084fd7418d2754529eaab8c91cef..ad079c27c00104b3a187a6d0e9384307f4929936 100644 (file)
@@ -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}}
+  };
+}