diff options
author | Le-Chun Wu <lcwu@gcc.gnu.org> | 2009-04-20 21:13:08 +0000 |
---|---|---|
committer | Le-Chun Wu <lcwu@gcc.gnu.org> | 2009-04-20 21:13:08 +0000 |
commit | 311fa510e6d737db7727ab6f4bd1c5598f2b217c (patch) | |
tree | 7d0125e6f6b8ac5da38604c980e416aa7193ee02 /gcc/cp | |
parent | 6e0f0975e5368803451b2642fb4ecc598310a2e4 (diff) | |
download | gcc-311fa510e6d737db7727ab6f4bd1c5598f2b217c.zip gcc-311fa510e6d737db7727ab6f4bd1c5598f2b217c.tar.gz gcc-311fa510e6d737db7727ab6f4bd1c5598f2b217c.tar.bz2 |
re PR c++/39803 (Bogus 'unused value' warning on declarations of non-POD arrays)
PR c++/39803
* gcc/cp/init.c (build_vec_init): Set TREE_NO_WARNING on the
compiler-generated INDIRECT_REF expression.
* gcc/testsuite/g++.dg/warn/Wunused-14.C: New test.
From-SVN: r146454
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/cp/init.c | 1 |
2 files changed, 8 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 0d014f5..15f83d9 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2009-04-20 Le-Chun Wu <lcwu@google.com> + + PR c++/39803 + * init.c (build_vec_init): Set TREE_NO_WARNING on the + compiler-generated INDIRECT_REF expression. + 2009-04-20 Ian Lance Taylor <iant@google.com> * typeck.c (build_function_call_vec): New function. @@ -34,7 +40,7 @@ * cp-tree.h (enum tsubst_flags): Rename from enum tsubst_flags_t. (tsubst_flags_t): Change typedef from enum type to int. -2009-04-16 Le-Chun Wu <lcwu@google.com> +2009-04-16 Paolo Bonzini <bonzini@gnu.org> * decl.c (check_initializer): Use TYPE_VECTOR_OPAQUE instead of targetm.vector_opaque_p. diff --git a/gcc/cp/init.c b/gcc/cp/init.c index 812042d..d40a5e7 100644 --- a/gcc/cp/init.c +++ b/gcc/cp/init.c @@ -2920,6 +2920,7 @@ build_vec_init (tree base, tree maxindex, tree init, atype = build_pointer_type (atype); stmt_expr = build1 (NOP_EXPR, atype, stmt_expr); stmt_expr = cp_build_indirect_ref (stmt_expr, NULL, complain); + TREE_NO_WARNING (stmt_expr) = 1; } current_stmt_tree ()->stmts_are_full_exprs_p = destroy_temps; |