From: Jakub Jelinek Date: Tue, 24 Jan 2017 22:33:41 +0000 (+0100) Subject: re PR c++/79205 (ICE in create_tmp_var, at gimple-expr.c:473) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=7cfd79d60bdc3884f2fb652ff609ef9783994bd1;p=gcc.git re PR c++/79205 (ICE in create_tmp_var, at gimple-expr.c:473) PR c++/79205 * cp-gimplify.c (cp_genericize_r): Add result of convert_from_reference on invisiref parm to p_set. * g++.dg/cpp1z/decomp22.C: New test. * g++.dg/cpp1z/decomp23.C: New test. From-SVN: r244885 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 5010aeb1303..05c6b609888 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2017-01-24 Jakub Jelinek + + PR c++/79205 + * cp-gimplify.c (cp_genericize_r): Add result of + convert_from_reference on invisiref parm to p_set. + 2017-01-24 Nathan Sidwell PR c++/78469 - defaulted ctor and inaccessible dtor diff --git a/gcc/cp/cp-gimplify.c b/gcc/cp/cp-gimplify.c index 2c59c076270..13647033f70 100644 --- a/gcc/cp/cp-gimplify.c +++ b/gcc/cp/cp-gimplify.c @@ -1107,6 +1107,7 @@ cp_genericize_r (tree *stmt_p, int *walk_subtrees, void *data) if (wtd->handle_invisiref_parm_p && is_invisiref_parm (stmt)) { *stmt_p = convert_from_reference (stmt); + p_set->add (*stmt_p); *walk_subtrees = 0; return NULL; } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 01df86dffd2..f8a9536886a 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2017-01-24 Jakub Jelinek + + PR c++/79205 + * g++.dg/cpp1z/decomp22.C: New test. + * g++.dg/cpp1z/decomp23.C: New test. + 2017-01-24 Nathan Sidwell PR c++/78469 diff --git a/gcc/testsuite/g++.dg/cpp1z/decomp22.C b/gcc/testsuite/g++.dg/cpp1z/decomp22.C new file mode 100644 index 00000000000..81d40c56931 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp1z/decomp22.C @@ -0,0 +1,21 @@ +// PR c++/79205 +// { dg-do compile { target c++11 } } +// { dg-options "" } + +template struct B; +template struct B { int b; }; +template struct C { B<0, E...> c; C (C &) = default; C (C &&); }; +template struct tuple_size; +template <> struct tuple_size> { static constexpr int value = 1; }; +template struct tuple_element; +template +struct tuple_element<0, C> { typedef int type; }; +template +int &&get (C &&); + +int +foo (C t) +{ + auto[x0] = t; // { dg-warning "decomposition declaration only available with" "" { target c++14_down } } + return x0; +} diff --git a/gcc/testsuite/g++.dg/cpp1z/decomp23.C b/gcc/testsuite/g++.dg/cpp1z/decomp23.C new file mode 100644 index 00000000000..c682fa00264 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp1z/decomp23.C @@ -0,0 +1,12 @@ +// PR c++/79205 +// { dg-do compile { target c++11 } } +// { dg-options "" } + +#include + +int +foo (std::tuple t) +{ + auto [x0] = t; // { dg-warning "decomposition declaration only available with" "" { target c++14_down } } + return x0; +}