diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2009-09-02 17:10:17 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2009-09-02 17:10:17 +0000 |
commit | 636a0ffbd2bda998236ddc9bb14b9222f7b49359 (patch) | |
tree | 436085f643b63cc27f1835ee91536f5e1889631f /test/CodeGenCXX/trivial-constructor-init.cpp | |
parent | c857ea4d22e1e6dd9ede1f0e84d48b157c6924fd (diff) |
Allow null initialization of scalara data members
in constructors's initializer list. pr4854
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80802 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGenCXX/trivial-constructor-init.cpp')
-rw-r--r-- | test/CodeGenCXX/trivial-constructor-init.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/test/CodeGenCXX/trivial-constructor-init.cpp b/test/CodeGenCXX/trivial-constructor-init.cpp new file mode 100644 index 0000000000..183b31a801 --- /dev/null +++ b/test/CodeGenCXX/trivial-constructor-init.cpp @@ -0,0 +1,21 @@ +// RUN: clang-cc -S %s -o %t-64.s && +// RUN: clang-cc -S %s -o %t-32.s && +// RUN: true + +extern "C" int printf(...); + +struct S { + S() { printf("S::S\n"); } +}; + +struct A { + double x; + A() : x(), y(), s() { printf("x = %f y = %x \n", x, y); } + int *y; + S s; +}; + +A a; + +int main() { +} |