Commit 2bbc5c34 by Jakub Jelinek Committed by Jakub Jelinek

re PR c++/83817 (internal compiler error: tree check: expected call_expr, have…

re PR c++/83817 (internal compiler error: tree check: expected call_expr, have aggr_init_expr in tsubst_copy_and_build, at cp/pt.c:17822)

	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.

	* g++.dg/cpp1y/pr83817.C: New test.

From-SVN: r256726
parent 774ae645
2018-01-16 Jakub Jelinek <jakub@redhat.com> 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 PR c++/83825
* name-lookup.c (member_vec_dedup): Return early if len is 0. * name-lookup.c (member_vec_dedup): Return early if len is 0.
(resort_type_member_vec, set_class_bindings, (resort_type_member_vec, set_class_bindings,
......
...@@ -17819,7 +17819,10 @@ tsubst_copy_and_build (tree t, ...@@ -17819,7 +17819,10 @@ tsubst_copy_and_build (tree t,
CALL_EXPR_REVERSE_ARGS (function) = rev; CALL_EXPR_REVERSE_ARGS (function) = rev;
if (thk) 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. */ /* The thunk location is not interesting. */
SET_EXPR_LOCATION (function, UNKNOWN_LOCATION); SET_EXPR_LOCATION (function, UNKNOWN_LOCATION);
} }
......
2018-01-16 Jakub Jelinek <jakub@redhat.com> 2018-01-16 Jakub Jelinek <jakub@redhat.com>
PR c++/83817
* g++.dg/cpp1y/pr83817.C: New test.
PR c++/83825 PR c++/83825
* g++.dg/template/pr83825.C: New test. * g++.dg/template/pr83825.C: New test.
......
// 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); }};
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