From: Jason Merrill Date: Fri, 24 Mar 2017 14:40:13 +0000 (-0400) Subject: PR c++/77339 - ICE with invalid use of alias template. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=90471a3d8330dff361297f72fa95c157e26ea345;p=gcc.git PR c++/77339 - ICE with invalid use of alias template. * pt.c (lookup_template_class_1): Don't try to enter the scope of an alias template. From-SVN: r246462 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index f8e711b160a..ea1eaa771a5 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2017-03-24 Jason Merrill + + PR c++/77339 - ICE with invalid use of alias template. + * pt.c (lookup_template_class_1): Don't try to enter the scope of an + alias template. + 2017-03-24 Marek Polacek PR c++/80119 diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 5259dad72a0..cbe80821b54 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -8682,9 +8682,9 @@ lookup_template_class_1 (tree d1, tree arglist, tree in_decl, tree context, || !PRIMARY_TEMPLATE_P (gen_tmpl) || currently_open_class (template_type)) { - tree tinfo = TYPE_TEMPLATE_INFO_MAYBE_ALIAS (template_type); + tree tinfo = TYPE_TEMPLATE_INFO (template_type); - if (comp_template_args (TI_ARGS (tinfo), arglist)) + if (tinfo && comp_template_args (TI_ARGS (tinfo), arglist)) return template_type; } diff --git a/gcc/testsuite/g++.dg/cpp0x/alias-decl-58.C b/gcc/testsuite/g++.dg/cpp0x/alias-decl-58.C new file mode 100644 index 00000000000..0ae1c499bd5 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/alias-decl-58.C @@ -0,0 +1,7 @@ +// PR c++/77339 +// { dg-do compile { target c++11 } } + +template < typename > using A = int; + +//OK: template < typename X > A < X > a; +template < typename X > A < X >::a; // { dg-error "" }