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 | fc60ca8801c74e25d8a1afb9be707a7fcb561de2 (patch) | |
tree | 2c7234ef0dc8acb60bc67b1f6e531201e937be56 /clang/test/CodeGenCXX/trivial-constructor-init.cpp | |
parent | 87d69e80b15b277f24c92b38dc8a7e1b51f0930f (diff) | |
download | bcm5719-llvm-fc60ca8801c74e25d8a1afb9be707a7fcb561de2.tar.gz bcm5719-llvm-fc60ca8801c74e25d8a1afb9be707a7fcb561de2.zip |
Allow null initialization of scalara data members
in constructors's initializer list. pr4854
llvm-svn: 80802
Diffstat (limited to 'clang/test/CodeGenCXX/trivial-constructor-init.cpp')
-rw-r--r-- | clang/test/CodeGenCXX/trivial-constructor-init.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/clang/test/CodeGenCXX/trivial-constructor-init.cpp b/clang/test/CodeGenCXX/trivial-constructor-init.cpp new file mode 100644 index 00000000000..183b31a801e --- /dev/null +++ b/clang/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() { +} |