xref: /minix3/external/bsd/llvm/dist/clang/test/Sema/empty2.c (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc // RUN: %clang_cc1 %s -fsyntax-only -verify -pedantic
2*f4a2713aSLionel Sambuc 
3*f4a2713aSLionel Sambuc struct emp_1 { // expected-warning {{empty struct is a GNU extension}}
4*f4a2713aSLionel Sambuc };
5*f4a2713aSLionel Sambuc 
6*f4a2713aSLionel Sambuc union emp_2 { // expected-warning {{empty union is a GNU extension}}
7*f4a2713aSLionel Sambuc };
8*f4a2713aSLionel Sambuc 
9*f4a2713aSLionel Sambuc struct emp_3 { // expected-warning {{struct without named members is a GNU extension}}
10*f4a2713aSLionel Sambuc   int : 0;
11*f4a2713aSLionel Sambuc };
12*f4a2713aSLionel Sambuc 
13*f4a2713aSLionel Sambuc union emp_4 { // expected-warning {{union without named members is a GNU extension}}
14*f4a2713aSLionel Sambuc   int : 0;
15*f4a2713aSLionel Sambuc };
16*f4a2713aSLionel Sambuc 
17*f4a2713aSLionel Sambuc struct emp_5 { // expected-warning {{struct without named members is a GNU extension}}
18*f4a2713aSLionel Sambuc   int : 0;
19*f4a2713aSLionel Sambuc   int : 0;
20*f4a2713aSLionel Sambuc };
21*f4a2713aSLionel Sambuc 
22*f4a2713aSLionel Sambuc union emp_6 { // expected-warning {{union without named members is a GNU extension}}
23*f4a2713aSLionel Sambuc   int : 0;
24*f4a2713aSLionel Sambuc   int : 0;
25*f4a2713aSLionel Sambuc };
26*f4a2713aSLionel Sambuc 
27*f4a2713aSLionel Sambuc struct nonamed_1 { // expected-warning {{struct without named members is a GNU extension}}
28*f4a2713aSLionel Sambuc   int : 4;
29*f4a2713aSLionel Sambuc };
30*f4a2713aSLionel Sambuc 
31*f4a2713aSLionel Sambuc union nonamed_2 { // expected-warning {{union without named members is a GNU extension}}
32*f4a2713aSLionel Sambuc   int : 4;
33*f4a2713aSLionel Sambuc };
34*f4a2713aSLionel Sambuc 
35*f4a2713aSLionel Sambuc struct nonamed_3 { // expected-warning {{struct without named members is a GNU extension}}
36*f4a2713aSLionel Sambuc   int : 4;
37*f4a2713aSLionel Sambuc   unsigned int : 4;
38*f4a2713aSLionel Sambuc };
39*f4a2713aSLionel Sambuc 
40*f4a2713aSLionel Sambuc union nonamed_4 { // expected-warning {{union without named members is a GNU extension}}
41*f4a2713aSLionel Sambuc   int : 4;
42*f4a2713aSLionel Sambuc   unsigned int : 4;
43*f4a2713aSLionel Sambuc };
44