2018-01-16 Jakub Jelinek <jakub@redhat.com>
+ PR c++/83817
+ * pt.c (tsubst_copy_and_build) <case CALL_EXPR>: If function
+ is AGGR_INIT_EXPR rather than CALL_EXPR, set AGGR_INIT_FROM_THUNK_P
+ instead of CALL_FROM_THUNK_P.
+
PR c++/83825
* name-lookup.c (member_vec_dedup): Return early if len is 0.
(resort_type_member_vec, set_class_bindings,
CALL_EXPR_REVERSE_ARGS (function) = rev;
if (thk)
{
- CALL_FROM_THUNK_P (function) = true;
+ if (TREE_CODE (function) == CALL_EXPR)
+ CALL_FROM_THUNK_P (function) = true;
+ else
+ AGGR_INIT_FROM_THUNK_P (function) = true;
/* The thunk location is not interesting. */
SET_EXPR_LOCATION (function, UNKNOWN_LOCATION);
}
2018-01-16 Jakub Jelinek <jakub@redhat.com>
+ PR c++/83817
+ * g++.dg/cpp1y/pr83817.C: New test.
+
PR c++/83825
* g++.dg/template/pr83825.C: New test.
--- /dev/null
+// PR c++/83817
+// { dg-do compile { target c++14 } }
+
+struct A;
+struct B { template <typename> using C = A; };
+struct D : B { struct F { typedef C<char> E; }; };
+struct G {
+ struct I { I (D, A &); } h;
+ D::F::E &k ();
+ D j;
+ G (G &&) : h (j, k ()) {}
+};
+struct N { G l; };
+typedef N (*M)(N &);
+struct H { const char *o; M s; };
+N foo (N &);
+H r { "", [](auto &x) { return foo (x); }};