re PR c++/63619 (warning: deleting ‘void*’ is undefined has no -W flag)

PR c++/63619

gcc/cp:
	PR c++/63619
	* decl2.c (delete_sanity): Use OPT_Wdelete_incomplete in warning.

gcc/testsuite:
	PR c++/63619
	* g++.dg/warn/Wdelete-incomplete-3.C: New.
	* g++.dg/warn/Wdelete-incomplete-4.C: New.

From-SVN: r216599
This commit is contained in:
Jonathan Wakely 2014-10-23 22:07:49 +01:00 committed by Jonathan Wakely
parent 5cbc4e2a24
commit 53b0f7471a
5 changed files with 25 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2014-10-23 Jonathan Wakely <jwakely@redhat.com>
PR c++/63619
* decl2.c (delete_sanity): Use OPT_Wdelete_incomplete in warning.
2014-10-21 Paolo Carlini <paolo.carlini@oracle.com>
* parser.c (cp_parser_unary_expression): Add default arguments.

View File

@ -478,7 +478,7 @@ delete_sanity (tree exp, tree size, bool doing_vec, int use_global_delete,
/* Deleting ptr to void is undefined behavior [expr.delete/3]. */
if (VOID_TYPE_P (TREE_TYPE (type)))
{
warning (0, "deleting %qT is undefined", type);
warning (OPT_Wdelete_incomplete, "deleting %qT is undefined", type);
doing_vec = 0;
}

View File

@ -1,3 +1,9 @@
2014-10-23 Jonathan Wakely <jwakely@redhat.com>
PR c++/63619
* g++.dg/warn/Wdelete-incomplete-3.C: New.
* g++.dg/warn/Wdelete-incomplete-4.C: New.
2014-10-23 Evgeny Stupachenko <evstupac@gmail.com>
PR target/63618

View File

@ -0,0 +1,6 @@
// PR c++/63619
int main() {
void* p;
delete p; // { dg-warning "undefined" }
}

View File

@ -0,0 +1,7 @@
// PR c++/63619
// { dg-options -Wno-delete-incomplete }
int main() {
void* p;
delete p;
}