re PR c++/71662 ([DR 1485] ICE on invalid C++11 code with unqualified name look up...
authorPaolo Carlini <paolo.carlini@oracle.com>
Wed, 7 Feb 2018 09:35:10 +0000 (09:35 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Wed, 7 Feb 2018 09:35:10 +0000 (09:35 +0000)
2018-02-07  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/71662
* g++.dg/cpp0x/scoped_enum7.C: New.

From-SVN: r257439

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

index 8737eefa5318c3ff450c8ba21ff58b4578acbf5e..8a0dc3c370cb58337207ef0a56103663eb77146d 100644 (file)
@@ -1,3 +1,8 @@
+2018-02-07  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/71662
+       * g++.dg/cpp0x/scoped_enum7.C: New.
+
 2018-02-07  Christophe Lyon <christophe.lyon@linaro.org>
 
        PR tree-optimization/83008
diff --git a/gcc/testsuite/g++.dg/cpp0x/scoped_enum7.C b/gcc/testsuite/g++.dg/cpp0x/scoped_enum7.C
new file mode 100644 (file)
index 0000000..1ba34b6
--- /dev/null
@@ -0,0 +1,19 @@
+// PR c++/71662
+// { dg-do compile { target c++11 } }
+// { dg-additional-options "-Wno-return-type" }
+
+template < typename T > struct A
+{
+  enum E : T;
+  E h ();
+};
+
+A < int > a;
+A < int >::E b = a.h ();
+
+template < typename T > enum A < T >::E : T { e };  // { dg-message "enumeration" }
+
+template < typename T > typename A < T >::E A < T >::h ()
+{
+  return e;  // { dg-error "declared" }
+}