summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenCXX/member-init-anon-union.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2012-05-07 01:07:30 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2012-05-07 01:07:30 +0000
commite2648bac3a12407d55b49f2bea5bbbee49a31118 (patch)
tree676c87afbbb557d5cec437ea734e113a1e28f67e /clang/test/CodeGenCXX/member-init-anon-union.cpp
parent0f09df1f523b6217aeaecefb21bce17714d0d0f4 (diff)
downloadbcm5719-llvm-e2648bac3a12407d55b49f2bea5bbbee49a31118.tar.gz
bcm5719-llvm-e2648bac3a12407d55b49f2bea5bbbee49a31118.zip
A union can have a constexpr defaulted default constructor, if it has an
in-class initializer for one of its fields. Value-initialization of such a type should use the in-class initializer! The former was just a bug, the latter is a (reported) standard defect. llvm-svn: 156274
Diffstat (limited to 'clang/test/CodeGenCXX/member-init-anon-union.cpp')
-rw-r--r--clang/test/CodeGenCXX/member-init-anon-union.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/clang/test/CodeGenCXX/member-init-anon-union.cpp b/clang/test/CodeGenCXX/member-init-anon-union.cpp
index 1ff7537387c..4db31f0b83f 100644
--- a/clang/test/CodeGenCXX/member-init-anon-union.cpp
+++ b/clang/test/CodeGenCXX/member-init-anon-union.cpp
@@ -2,8 +2,10 @@
// PR10531.
+int make_a();
+
static union {
- int a = 42;
+ int a = make_a();
char *b;
};
@@ -32,4 +34,4 @@ int g() {
// CHECK: define {{.*}}@"[[CONSTRUCT_GLOBAL]]C2Ev"
// CHECK-NOT: }
-// CHECK: store i32 42
+// CHECK: call {{.*}}@_Z6make_a
OpenPOWER on IntegriCloud