Home | History | Annotate | Download | only in Sema
      1 // RUN: %clang_cc1 %s -fsyntax-only -verify -Wc++-compat
      2 
      3 struct emp_1 { // expected-warning {{empty struct has size 0 in C, size 1 in C++}}
      4 };
      5 
      6 union emp_2 { // expected-warning {{empty union has size 0 in C, size 1 in C++}}
      7 };
      8 
      9 struct emp_3 { // expected-warning {{struct has size 0 in C, size 1 in C++}}
     10   int : 0;
     11 };
     12 
     13 union emp_4 { // expected-warning {{union has size 0 in C, size 1 in C++}}
     14   int : 0;
     15 };
     16 
     17 struct emp_5 { // expected-warning {{struct has size 0 in C, size 1 in C++}}
     18   int : 0;
     19   int : 0;
     20 };
     21 
     22 union emp_6 { // expected-warning {{union has size 0 in C, size 1 in C++}}
     23   int : 0;
     24   int : 0;
     25 };
     26 
     27 struct emp_7 { // expected-warning {{struct has size 0 in C, size 1 in C++}}
     28   struct emp_1 f1;
     29 };
     30 
     31 union emp_8 { // expected-warning {{union has size 0 in C, size 1 in C++}}
     32   struct emp_1 f1;
     33 };
     34 
     35 struct emp_9 { // expected-warning {{struct has size 0 in C, non-zero size in C++}}
     36   struct emp_1 f1;
     37   union emp_2 f2;
     38 };
     39