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:
parent
5cbc4e2a24
commit
53b0f7471a
@ -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.
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
|
6
gcc/testsuite/g++.dg/warn/Wdelete-incomplete-3.C
Normal file
6
gcc/testsuite/g++.dg/warn/Wdelete-incomplete-3.C
Normal file
@ -0,0 +1,6 @@
|
||||
// PR c++/63619
|
||||
|
||||
int main() {
|
||||
void* p;
|
||||
delete p; // { dg-warning "undefined" }
|
||||
}
|
7
gcc/testsuite/g++.dg/warn/Wdelete-incomplete-4.C
Normal file
7
gcc/testsuite/g++.dg/warn/Wdelete-incomplete-4.C
Normal file
@ -0,0 +1,7 @@
|
||||
// PR c++/63619
|
||||
// { dg-options -Wno-delete-incomplete }
|
||||
|
||||
int main() {
|
||||
void* p;
|
||||
delete p;
|
||||
}
|
Loading…
Reference in New Issue
Block a user