diff options
author | Jason Merrill <jason@redhat.com> | 2020-06-05 16:36:27 -0400 |
---|---|---|
committer | Jason Merrill <jason@redhat.com> | 2020-06-09 15:31:51 -0400 |
commit | 77103685ff4b50b3c4d7ee76688bdf452acc82c7 (patch) | |
tree | 02414b1b8578c53c9922428d49a46a975acaa020 /contrib | |
parent | ab2789ec507a94f1a75a6534bca51c7b39037ce0 (diff) | |
download | gcc-77103685ff4b50b3c4d7ee76688bdf452acc82c7.zip gcc-77103685ff4b50b3c4d7ee76688bdf452acc82c7.tar.gz gcc-77103685ff4b50b3c4d7ee76688bdf452acc82c7.tar.bz2 |
tree-inline: Fix VLA handling [PR95552]
The problem in this testcase comes from cloning the constructor into
complete and base variants. When we clone the body the first time,
walk_tree_1 calls copy_tree_body_r on the type of the artificial TYPE_DECL
we made for the VLA type without calling it on the decl itself, so we
overwrite the type of the TYPE_DECL without copying the decl first.
This has been broken since we started inserting a TYPE_DECL for anonymous
VLAs in r7-457.
This patch fixes walk_tree_1 to call the function on the TYPE_DECL, as we do
for other decls of a DECL_EXPR.
gcc/ChangeLog:
PR c++/95552
* tree.c (walk_tree_1): Call func on the TYPE_DECL of a DECL_EXPR.
gcc/testsuite/ChangeLog:
PR c++/95552
* g++.dg/ext/vla23.C: New test.
Diffstat (limited to 'contrib')
0 files changed, 0 insertions, 0 deletions