]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - gcc/testsuite/g++.dg/template/access2.C
c++: limit instantiation with ill-formed class [PR96286]
[thirdparty/gcc.git] / gcc / testsuite / g++.dg / template / access2.C
index 0620c10f79dc0125ed36906a1cc0a5380b531e89..4a80bb4d2806d2b1771909efc1009199cfd8a9b7 100644 (file)
@@ -5,6 +5,9 @@
 
 template <class T> struct A {
   typename T::X x;                     // { dg-error "this context" }
+};
+
+template <class T> struct A2 {
   int f() { return T::i; }             // { dg-error "this context" }
 };
 
@@ -16,5 +19,6 @@ class B {
 int main()
 {
   A<B> ab;                             // { dg-message "required" }
-  ab.f();                              // { dg-message "required" }
+  A2<B> a2b;
+  a2b.f();                             // { dg-message "required" }
 }