From: Marek Polacek Date: Wed, 13 Feb 2019 16:35:44 +0000 (+0000) Subject: re PR c++/77304 (ICE on C++ code with invalid template parameter: in gimplify_expr... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=2db698cefc5b7e2a66ca64d8485dd9156ee7442f;p=gcc.git re PR c++/77304 (ICE on C++ code with invalid template parameter: in gimplify_expr, at gimplify.c:11260) PR c++/77304 * g++.dg/cpp2a/nontype-class13.C: New test. From-SVN: r268849 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index f1a8295aef9..bda30c8eae7 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2019-02-13 Marek Polacek + + PR c++/77304 + * g++.dg/cpp2a/nontype-class13.C: New test. + 2019-02-13 Wilco Dijkstra PR target/89190 diff --git a/gcc/testsuite/g++.dg/cpp2a/nontype-class13.C b/gcc/testsuite/g++.dg/cpp2a/nontype-class13.C new file mode 100644 index 00000000000..14c601ba040 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp2a/nontype-class13.C @@ -0,0 +1,21 @@ +// PR c++/77304 +// { dg-do compile { target c++2a } } + +struct S {}; + +template < typename T > struct A +{ + template < S > void f () {} + + static void * g () + { + return (void *) f < a >; // { dg-error "invalid" } + } + + static S a; +}; + +void * f () +{ + return A < int >::g (); +}