aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/tree.c
diff options
context:
space:
mode:
authorPaolo Carlini <paolo.carlini@oracle.com>2012-10-31 19:14:39 +0000
committerPaolo Carlini <paolo@gcc.gnu.org>2012-10-31 19:14:39 +0000
commit03d31730bfa422561a7e62915eb2c304bac27f19 (patch)
treed339efb27257d9e65568af0b81ffe366c045baa2 /gcc/cp/tree.c
parent4d64ce5c057fe0d3cd601d3e6b03b76f2989f13d (diff)
downloadgcc-03d31730bfa422561a7e62915eb2c304bac27f19.zip
gcc-03d31730bfa422561a7e62915eb2c304bac27f19.tar.gz
gcc-03d31730bfa422561a7e62915eb2c304bac27f19.tar.bz2
re PR c++/54583 (Spurious warning: value computed is not used with variable-size array)
/cp 2012-10-31 Paolo Carlini <paolo.carlini@oracle.com> PR c++/54583 * tree.c (build_cplus_array_type): Set TREE_NO_WARNING on the TYPE_SIZE of VLAs. /testsuite 2012-10-31 Paolo Carlini <paolo.carlini@oracle.com> PR c++/54583 * g++.dg/ext/vla13.C: New. From-SVN: r193043
Diffstat (limited to 'gcc/cp/tree.c')
-rw-r--r--gcc/cp/tree.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c
index 8d555c2..bcc2779 100644
--- a/gcc/cp/tree.c
+++ b/gcc/cp/tree.c
@@ -824,6 +824,10 @@ build_cplus_array_type (tree elt_type, tree index_type)
}
}
+ /* Avoid spurious warnings with VLAs (c++/54583). */
+ if (TYPE_SIZE (t) && EXPR_P (TYPE_SIZE (t)))
+ TREE_NO_WARNING (TYPE_SIZE (t)) = 1;
+
/* Push these needs up so that initialization takes place
more easily. */
TYPE_NEEDS_CONSTRUCTING (t)