diff options
author | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-09-09 22:08:46 +0000 |
---|---|---|
committer | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-09-09 22:08:46 +0000 |
commit | fedb5c1d83dcffee2c91432eb035817fdd3251a6 (patch) | |
tree | d198409c341089c5a9ceb5354c3015ff947c8de1 /gcc | |
parent | b236ac0e3665332059bec7d14aa28e23d207663d (diff) | |
download | gcc-fedb5c1d83dcffee2c91432eb035817fdd3251a6.tar.gz |
PR c++/37417
* tree.c (array_type_nelts_top): Add size_one_node instead of
integer_one_node.
* g++.dg/ext/vla5.C: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@140178 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cp/tree.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 3 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/ext/vla5.C | 10 |
4 files changed, 20 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 9760ccfca04..cc70e9e5004 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2008-09-09 Jakub Jelinek <jakub@redhat.com> + + PR c++/37417 + * tree.c (array_type_nelts_top): Add size_one_node instead of + integer_one_node. + 2008-09-09 Jason Merrill <jason@redhat.com> PR c++/37439 diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c index 912676393d0..fb3e8fc956c 100644 --- a/gcc/cp/tree.c +++ b/gcc/cp/tree.c @@ -1461,7 +1461,7 @@ array_type_nelts_top (tree type) { return fold_build2 (PLUS_EXPR, sizetype, array_type_nelts (type), - integer_one_node); + size_one_node); } /* Return, as an INTEGER_CST node, the number of elements for TYPE diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 55464c0c396..6e14ee51bd9 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,8 @@ 2008-09-09 Jakub Jelinek <jakub@redhat.com> + PR c++/37417 + * g++.dg/ext/vla5.C: New test. + PR middle-end/37356 * g++.dg/tree-ssa/pr37356.C: New test. diff --git a/gcc/testsuite/g++.dg/ext/vla5.C b/gcc/testsuite/g++.dg/ext/vla5.C new file mode 100644 index 00000000000..021d4846946 --- /dev/null +++ b/gcc/testsuite/g++.dg/ext/vla5.C @@ -0,0 +1,10 @@ +// PR c++/37417 +// Testcase by Martin Michlmayr <tbm@cyrius.com> +// { dg-do compile } +// { dg-options "-O" } + +void +test (int a) +{ + new (char[a]); +} |