diff options
author | Douglas Gregor <dgregor@apple.com> | 2011-11-02 23:04:16 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2011-11-02 23:04:16 +0000 |
commit | ddb21473ef1ff20b3abf7ba3cd6cb29acbd5cf06 (patch) | |
tree | f2fb24e81bce77ba33239a187e2a060d550b1429 /test/SemaCXX/zero-length-arrays.cpp | |
parent | c637d738897b1745af3bad7fc551f26b98da838c (diff) |
Don't build member initializers for zero-length or incomplete arrays,
and don't try to destroy them, either. Fixes
<rdar://problem/10228639>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143584 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaCXX/zero-length-arrays.cpp')
-rw-r--r-- | test/SemaCXX/zero-length-arrays.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/test/SemaCXX/zero-length-arrays.cpp b/test/SemaCXX/zero-length-arrays.cpp new file mode 100644 index 0000000000..05ded4ad9b --- /dev/null +++ b/test/SemaCXX/zero-length-arrays.cpp @@ -0,0 +1,26 @@ +// RUN: %clang_cc1 -fsyntax-only -verify %s + +// <rdar://problem/10228639> +class Foo { + ~Foo(); + Foo(const Foo&); +public: + Foo(int); +}; + +class Bar { + int foo_count; + Foo foos[0]; + Foo foos2[0][2]; + Foo foos3[2][0]; + +public: + Bar(): foo_count(0) { } + ~Bar() { } +}; + +void testBar() { + Bar b; + Bar b2(b); + b = b2; +} |