re PR c++/13813 ([DR206] Incomplete member variables in a template.)
authorGiovanni Bajo <giovannibajo@gcc.gnu.org>
Fri, 30 Jan 2004 16:40:43 +0000 (16:40 +0000)
committerGiovanni Bajo <giovannibajo@gcc.gnu.org>
Fri, 30 Jan 2004 16:40:43 +0000 (16:40 +0000)
DR206
PR c++/13813
* g++.dg/template/member4.C: New test.

From-SVN: r76971

gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/template/member4.C [new file with mode: 0644]

index b1ba65bd5b7341d576a9259618a35b9f41dbe6f6..d4138f7dcac200f7fcc6b1023f808397cccb7837 100644 (file)
@@ -1,3 +1,9 @@
+2004-01-30  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
+
+       DR206
+       PR c++/13813
+       * g++.dg/template/member4.C: New test.
+
 2004-01-30  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
 
        PR c++/13683
diff --git a/gcc/testsuite/g++.dg/template/member4.C b/gcc/testsuite/g++.dg/template/member4.C
new file mode 100644 (file)
index 0000000..290fbb5
--- /dev/null
@@ -0,0 +1,20 @@
+// { dg-do compile }
+// Contributed by Matty T. <mattyt-bugzilla at tpg dot com dot au>
+// PR c++/13813 [DR206]: Check semantic constraints of members of 
+//   non-dependent type at instantiation time.
+
+
+// DR206 explains that this is ill-formed, no diagnostic required. We emit
+//  a diagnostic instead.
+class E; 
+template < class A > class Z { 
+  A a;
+  E e;   // { dg-error "incomplete type" }
+};
+
+
+// Nested classes are always dependent names.
+template < class A > class Y { 
+  class F; 
+  F e;   // { dg-bogus "" "nested classes are always dependent, see DR108 and DR224" }
+};