annotate gcc/testsuite/g++.dg/warn/incomplete1.C @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children 1830386684a0
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 // { dg-do compile }
kono
parents:
diff changeset
2
kono
parents:
diff changeset
3 // Contributed by Brian Gaeke; public domain.
kono
parents:
diff changeset
4
kono
parents:
diff changeset
5 // 5 If the object being deleted has incomplete class type at the
kono
parents:
diff changeset
6 // point of deletion and the complete class has a non-trivial
kono
parents:
diff changeset
7 // destructor or a deallocation function, the behavior is undefined.
kono
parents:
diff changeset
8
kono
parents:
diff changeset
9 // (But the deletion does not constitute an ill-formed program. So the
kono
parents:
diff changeset
10 // program should nevertheless compile, but it should give a warning.)
kono
parents:
diff changeset
11
kono
parents:
diff changeset
12 class A; // { dg-message "forward declaration of 'class A'" }
kono
parents:
diff changeset
13
kono
parents:
diff changeset
14 A *a; // { dg-warning "'a' has incomplete type" }
kono
parents:
diff changeset
15
kono
parents:
diff changeset
16 int
kono
parents:
diff changeset
17 main (int argc, char **argv)
kono
parents:
diff changeset
18 {
kono
parents:
diff changeset
19 delete a; // { dg-warning "delete" "warn" }
kono
parents:
diff changeset
20 // { dg-message "note" "note" { target *-*-* } .-1 }
kono
parents:
diff changeset
21 return 0;
kono
parents:
diff changeset
22 }