annotate gcc/testsuite/gcc.dg/struct-semi-2.c @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 /* Test diagnostics for missing and extra semicolons in structures.
kono
parents:
diff changeset
2 Test with -pedantic. */
kono
parents:
diff changeset
3 /* Origin: Joseph Myers <joseph@codesourcery.com> */
kono
parents:
diff changeset
4 /* { dg-do compile } */
kono
parents:
diff changeset
5 /* { dg-options "-pedantic" } */
kono
parents:
diff changeset
6
kono
parents:
diff changeset
7 struct s0 { ; }; /* { dg-warning "extra semicolon in struct or union specified" } */
kono
parents:
diff changeset
8 /* { dg-warning "struct has no members" "empty" { target *-*-* } .-1 } */
kono
parents:
diff changeset
9 struct s1 {
kono
parents:
diff changeset
10 int a;
kono
parents:
diff changeset
11 ; /* { dg-warning "extra semicolon in struct or union specified" } */
kono
parents:
diff changeset
12 int b;
kono
parents:
diff changeset
13 };
kono
parents:
diff changeset
14 struct s2 {
kono
parents:
diff changeset
15 ; /* { dg-warning "extra semicolon in struct or union specified" } */
kono
parents:
diff changeset
16 int c
kono
parents:
diff changeset
17 }; /* { dg-warning "no semicolon at end of struct or union" } */
kono
parents:
diff changeset
18 struct s3 {
kono
parents:
diff changeset
19 int d
kono
parents:
diff changeset
20 }; /* { dg-warning "no semicolon at end of struct or union" } */