From: Paolo Carlini Date: Wed, 7 Feb 2018 09:35:10 +0000 (+0000) Subject: re PR c++/71662 ([DR 1485] ICE on invalid C++11 code with unqualified name look up... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=07a6816e61d35c8b1a9e89e2699d47807f72e668;p=gcc.git re PR c++/71662 ([DR 1485] ICE on invalid C++11 code with unqualified name look up: in tsubst_copy, at cp/pt.c:14010) 2018-02-07 Paolo Carlini PR c++/71662 * g++.dg/cpp0x/scoped_enum7.C: New. From-SVN: r257439 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 8737eefa531..8a0dc3c370c 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2018-02-07 Paolo Carlini + + PR c++/71662 + * g++.dg/cpp0x/scoped_enum7.C: New. + 2018-02-07 Christophe Lyon 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 index 00000000000..1ba34b6e987 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/scoped_enum7.C @@ -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" } +}