diff options
author | Paolo Carlini <paolo.carlini@oracle.com> | 2012-05-23 14:19:27 +0000 |
---|---|---|
committer | Paolo Carlini <paolo@gcc.gnu.org> | 2012-05-23 14:19:27 +0000 |
commit | 0a9696f0225d1ab4a8d3a992c9e98f68e9996876 (patch) | |
tree | bc5bfada5b01bc7295cda02728be8d6d6be43c9e /gcc/cp/decl2.c | |
parent | 9c09f152d90089509bcc4b5b8094fbbb1707fbc1 (diff) | |
download | gcc-0a9696f0225d1ab4a8d3a992c9e98f68e9996876.zip gcc-0a9696f0225d1ab4a8d3a992c9e98f68e9996876.tar.gz gcc-0a9696f0225d1ab4a8d3a992c9e98f68e9996876.tar.bz2 |
re PR c++/29185 (inconsistent warning: deleting array)
/cp
2012-05-23 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/29185
* decl2.c (delete_sanity): Extend 'deleting array' warning to
any array type.
/testsuite
2012-05-23 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/29185
* g++.dg/warn/delete-array-1.C: New.
From-SVN: r187801
Diffstat (limited to 'gcc/cp/decl2.c')
-rw-r--r-- | gcc/cp/decl2.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c index c40b830..bf9ca33 100644 --- a/gcc/cp/decl2.c +++ b/gcc/cp/decl2.c @@ -438,9 +438,8 @@ delete_sanity (tree exp, tree size, bool doing_vec, int use_global_delete, } /* An array can't have been allocated by new, so complain. */ - if (TREE_CODE (exp) == VAR_DECL - && TREE_CODE (TREE_TYPE (exp)) == ARRAY_TYPE) - warning (0, "deleting array %q#D", exp); + if (TREE_CODE (TREE_TYPE (exp)) == ARRAY_TYPE) + warning (0, "deleting array %q#E", exp); t = build_expr_type_conversion (WANT_POINTER, exp, true); |