diff options
Diffstat (limited to 'clang/test/Sema/empty1.c')
-rw-r--r-- | clang/test/Sema/empty1.c | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/clang/test/Sema/empty1.c b/clang/test/Sema/empty1.c index cd4aca8e473..d716ba52bb4 100644 --- a/clang/test/Sema/empty1.c +++ b/clang/test/Sema/empty1.c @@ -6,20 +6,33 @@ struct emp_1 { // expected-warning {{empty struct has size 0 in C, size 1 in C++ union emp_2 { // expected-warning {{empty union has size 0 in C, size 1 in C++}} }; -struct emp_3 { // expected-warning {{struct with only bit-fields of width 0 has size 0 in C, size 1 in C++}} +struct emp_3 { // expected-warning {{struct has size 0 in C, size 1 in C++}} int : 0; }; -union emp_4 { // expected-warning {{union with only bit-fields of width 0 has size 0 in C, size 1 in C++}} +union emp_4 { // expected-warning {{union has size 0 in C, size 1 in C++}} int : 0; }; -struct emp_5 { // expected-warning {{struct with only bit-fields of width 0 has size 0 in C, size 1 in C++}} +struct emp_5 { // expected-warning {{struct has size 0 in C, size 1 in C++}} int : 0; int : 0; }; -union emp_6 { // expected-warning {{union with only bit-fields of width 0 has size 0 in C, size 1 in C++}} +union emp_6 { // expected-warning {{union has size 0 in C, size 1 in C++}} int : 0; int : 0; }; + +struct emp_7 { // expected-warning {{struct has size 0 in C, size 1 in C++}} + struct emp_1 f1; +}; + +union emp_8 { // expected-warning {{union has size 0 in C, size 1 in C++}} + struct emp_1 f1; +}; + +struct emp_9 { // expected-warning {{struct has size 0 in C, non-zero size in C++}} + struct emp_1 f1; + union emp_2 f2; +}; |