Commit df15a828 by Jason Merrill

c++: Fix ICE with omitted template args [PR93956].

reshape_init only wants to work on BRACE_ENCLOSED_INITIALIZER_P, i.e. raw
initializer lists, and here was getting a CONSTRUCTOR that had already been
processed for type A<int>.  maybe_aggr_guide should also use that test.

gcc/cp/ChangeLog
2020-03-10  Jason Merrill  <jason@redhat.com>

	PR c++/93956
	* pt.c (maybe_aggr_guide): Check BRACE_ENCLOSED_INITIALIZER_P.
parent 37e0df8a
2020-03-10 Jason Merrill <jason@redhat.com> 2020-03-10 Jason Merrill <jason@redhat.com>
PR c++/93956
* pt.c (maybe_aggr_guide): Check BRACE_ENCLOSED_INITIALIZER_P.
2020-03-10 Jason Merrill <jason@redhat.com>
PR c++/93922 PR c++/93922
PR c++/94041 PR c++/94041
PR c++/52320 PR c++/52320
......
...@@ -28182,7 +28182,7 @@ maybe_aggr_guide (tree tmpl, tree init, vec<tree,va_gc> *args) ...@@ -28182,7 +28182,7 @@ maybe_aggr_guide (tree tmpl, tree init, vec<tree,va_gc> *args)
tsubst_flags_t complain = tf_none; tsubst_flags_t complain = tf_none;
tree parms = NULL_TREE; tree parms = NULL_TREE;
if (TREE_CODE (init) == CONSTRUCTOR) if (BRACE_ENCLOSED_INITIALIZER_P (init))
{ {
init = reshape_init (type, init, complain); init = reshape_init (type, init, complain);
if (init == error_mark_node) if (init == error_mark_node)
......
// PR c++/93596
template <typename> struct A {};
template <typename> struct B {};
template <typename> struct C {
void foo () { B a = A<int> { foo }; } // { dg-error "" }
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment