| 1 |
// { dg-do compile } |
| 2 |
/* { dg-options "-O2" } */ |
| 3 |
|
| 4 |
class A; // { dg-message "7:forward declaration of 'class A'" } |
| 5 |
|
| 6 |
A *a; // { dg-warning "4:'a' has incomplete type" "" { target c++23_down } } |
| 7 |
|
| 8 |
int |
| 9 |
main (int argc, char **argv) |
| 10 |
{ |
| 11 |
delete a; // { dg-warning "3:possible problem detected in invocation of .operator delete." "warn" { target c++23_down } } |
| 12 |
// { dg-message "3:neither the destructor nor the class-specific" "note" { target c++23_down } .-1 } |
| 13 |
// { dg-error "operator 'delete' used on incomplete type" "" { target c++26 } .-2 } |
| 14 |
return 0; |
| 15 |
} |