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
This commit is contained in:
parent
4d64ce5c05
commit
03d31730bf
4 changed files with 23 additions and 0 deletions
|
@ -1,3 +1,9 @@
|
|||
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.
|
||||
|
||||
2012-10-31 Dodji Seketeli <dodji@redhat.com>
|
||||
|
||||
PR c++/54955
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
2012-10-31 Paolo Carlini <paolo.carlini@oracle.com>
|
||||
|
||||
PR c++/54583
|
||||
* g++.dg/ext/vla13.C: New.
|
||||
|
||||
2012-10-31 Vladimir Makarov <vmakarov@redhat.com>
|
||||
|
||||
PR middle-end/55150
|
||||
|
|
8
gcc/testsuite/g++.dg/ext/vla13.C
Normal file
8
gcc/testsuite/g++.dg/ext/vla13.C
Normal file
|
@ -0,0 +1,8 @@
|
|||
// PR c++/54583
|
||||
// { dg-options "-Wunused-value" }
|
||||
|
||||
void fred()
|
||||
{
|
||||
int n=10;
|
||||
double (*x)[n];
|
||||
}
|
Loading…
Add table
Reference in a new issue