diff options
Diffstat (limited to 'clang/test/SemaCXX/non-empty-class-size-zero.cpp')
-rw-r--r-- | clang/test/SemaCXX/non-empty-class-size-zero.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/non-empty-class-size-zero.cpp b/clang/test/SemaCXX/non-empty-class-size-zero.cpp new file mode 100644 index 0000000..6b714db --- /dev/null +++ b/clang/test/SemaCXX/non-empty-class-size-zero.cpp @@ -0,0 +1,18 @@ +// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fsyntax-only %s +// rdar://8945175 + +struct X { + int array[0]; + int array1[0]; + int array2[0]; + X(); + ~X(); +}; + +struct Y { + int first; + X padding; + int second; +}; + +int zero_size_array[(sizeof(Y) == 8) -1]; // no error here! |