PR c++/80096 - ICE with C++17 non-type auto.
* pt.c (tsubst): Delay tsubst of type of template non-type parameter. From-SVN: r246292
This commit is contained in:
parent
18f73c5f24
commit
55b11c6090
|
@ -1,5 +1,9 @@
|
||||||
2017-03-20 Jason Merrill <jason@redhat.com>
|
2017-03-20 Jason Merrill <jason@redhat.com>
|
||||||
|
|
||||||
|
PR c++/80096 - ICE with C++17 non-type auto.
|
||||||
|
* pt.c (tsubst): Delay tsubst of type of template non-type
|
||||||
|
parameter.
|
||||||
|
|
||||||
PR c++/79519 - ICE with deleted template friend.
|
PR c++/79519 - ICE with deleted template friend.
|
||||||
* decl.c (grokdeclarator): Complain about misplaced function
|
* decl.c (grokdeclarator): Complain about misplaced function
|
||||||
definition using =, as well.
|
definition using =, as well.
|
||||||
|
|
|
@ -13388,6 +13388,7 @@ tsubst (tree t, tree args, tsubst_flags_t complain, tree in_decl)
|
||||||
if (type
|
if (type
|
||||||
&& code != TYPENAME_TYPE
|
&& code != TYPENAME_TYPE
|
||||||
&& code != TEMPLATE_TYPE_PARM
|
&& code != TEMPLATE_TYPE_PARM
|
||||||
|
&& code != TEMPLATE_PARM_INDEX
|
||||||
&& code != IDENTIFIER_NODE
|
&& code != IDENTIFIER_NODE
|
||||||
&& code != FUNCTION_TYPE
|
&& code != FUNCTION_TYPE
|
||||||
&& code != METHOD_TYPE)
|
&& code != METHOD_TYPE)
|
||||||
|
@ -13690,6 +13691,10 @@ tsubst (tree t, tree args, tsubst_flags_t complain, tree in_decl)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case TEMPLATE_PARM_INDEX:
|
case TEMPLATE_PARM_INDEX:
|
||||||
|
/* OK, now substitute the type of the non-type parameter. We
|
||||||
|
couldn't do it earlier because it might be an auto parameter,
|
||||||
|
and we wouldn't need to if we had an argument. */
|
||||||
|
type = tsubst (type, args, complain, in_decl);
|
||||||
r = reduce_template_parm_level (t, type, levels, args, complain);
|
r = reduce_template_parm_level (t, type, levels, args, complain);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
// PR c++/80096
|
||||||
|
// { dg-options -std=c++1z }
|
||||||
|
|
||||||
|
template<auto> struct A
|
||||||
|
{
|
||||||
|
template<int> struct B {};
|
||||||
|
};
|
||||||
|
|
||||||
|
A<0> a;
|
Loading…
Reference in New Issue