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.
+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
tsubst_flags_t complain = tf_none;
tree parms = NULL_TREE;
- if (TREE_CODE (init) == CONSTRUCTOR)
+ if (BRACE_ENCLOSED_INITIALIZER_P (init))
{
init = reshape_init (type, init, complain);
if (init == error_mark_node)
--- /dev/null
+// PR c++/93596
+
+template <typename> struct A {};
+template <typename> struct B {};
+template <typename> struct C {
+ void foo () { B a = A<int> { foo }; } // { dg-error "" }
+};