[cfe-commits] r111359 - /cfe/trunk/test/SemaCXX/abstract.cpp

John McCall rjmccall at apple.com
Wed Aug 18 02:58:15 PDT 2010


Author: rjmccall
Date: Wed Aug 18 04:58:15 2010
New Revision: 111359

URL: http://llvm.org/viewvc/llvm-project?rev=111359&view=rev
Log:
Flesh out the test cases a little.


Modified:
    cfe/trunk/test/SemaCXX/abstract.cpp

Modified: cfe/trunk/test/SemaCXX/abstract.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/abstract.cpp?rev=111359&r1=111358&r2=111359&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/abstract.cpp (original)
+++ cfe/trunk/test/SemaCXX/abstract.cpp Wed Aug 18 04:58:15 2010
@@ -205,3 +205,47 @@
     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}}
+  };
+}





More information about the cfe-commits mailing list