Home | History | Annotate | Download | only in Sema
      1 // RUN: %clang_cc1 %s -fsyntax-only -verify -pedantic
      2 
      3 struct emp_1 { // expected-warning {{empty struct is a GNU extension}}
      4 };
      5 
      6 union emp_2 { // expected-warning {{empty union is a GNU extension}}
      7 };
      8 
      9 struct emp_3 { // expected-warning {{struct without named members is a GNU extension}}
     10   int : 0;
     11 };
     12 
     13 union emp_4 { // expected-warning {{union without named members is a GNU extension}}
     14   int : 0;
     15 };
     16 
     17 struct emp_5 { // expected-warning {{struct without named members is a GNU extension}}
     18   int : 0;
     19   int : 0;
     20 };
     21 
     22 union emp_6 { // expected-warning {{union without named members is a GNU extension}}
     23   int : 0;
     24   int : 0;
     25 };
     26 
     27 struct nonamed_1 { // expected-warning {{struct without named members is a GNU extension}}
     28   int : 4;
     29 };
     30 
     31 union nonamed_2 { // expected-warning {{union without named members is a GNU extension}}
     32   int : 4;
     33 };
     34 
     35 struct nonamed_3 { // expected-warning {{struct without named members is a GNU extension}}
     36   int : 4;
     37   unsigned int : 4;
     38 };
     39 
     40 union nonamed_4 { // expected-warning {{union without named members is a GNU extension}}
     41   int : 4;
     42   unsigned int : 4;
     43 };
     44