From: Jakub Jelinek Date: Tue, 16 Jan 2018 08:44:48 +0000 (+0100) Subject: re PR c++/83817 (internal compiler error: tree check: expected call_expr, have aggr_i... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=2bbc5c34e4cd000532dfdf68fd294f02ba5f1dbb;p=gcc.git 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) : 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 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 2371a54d004..a0119e14640 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,10 @@ 2018-01-16 Jakub Jelinek + PR c++/83817 + * pt.c (tsubst_copy_and_build) : 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, diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index bb5908fb853..322408d92ec 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -17819,7 +17819,10 @@ tsubst_copy_and_build (tree t, 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); } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 2a44bb18080..7bbeafafa34 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,8 @@ 2018-01-16 Jakub Jelinek + PR c++/83817 + * g++.dg/cpp1y/pr83817.C: New test. + PR c++/83825 * g++.dg/template/pr83825.C: New test. diff --git a/gcc/testsuite/g++.dg/cpp1y/pr83817.C b/gcc/testsuite/g++.dg/cpp1y/pr83817.C new file mode 100644 index 00000000000..9a69cbb201c --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp1y/pr83817.C @@ -0,0 +1,17 @@ +// PR c++/83817 +// { dg-do compile { target c++14 } } + +struct A; +struct B { template using C = A; }; +struct D : B { struct F { typedef C 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); }};