Commit 53b0f747 by Jonathan Wakely Committed by Jonathan Wakely

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
parent 5cbc4e2a
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.
......
......@@ -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;
}
......
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
......
// PR c++/63619
int main() {
void* p;
delete p; // { dg-warning "undefined" }
}
// PR c++/63619
// { dg-options -Wno-delete-incomplete }
int main() {
void* p;
delete p;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment