diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2016-12-21 01:57:02 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2016-12-21 01:57:02 +0000 |
commit | 505ef81422b96a1e3ff87b942ff1e1a45f3d0f00 (patch) | |
tree | a880388db58b2d46d764c69409ba50ae1f33047c /clang/test/CodeGenCXX/value-init.cpp | |
parent | 77794843134ecfb62de53df934346815ba634481 (diff) | |
download | bcm5719-llvm-505ef81422b96a1e3ff87b942ff1e1a45f3d0f00.tar.gz bcm5719-llvm-505ef81422b96a1e3ff87b942ff1e1a45f3d0f00.zip |
Fix defaulted-functions-in-C++98 extension to give the functions the same
effect they would have in C++11. In particular, they do not prevent
value-initialization from performing zero-initialization, nor do they prevent a
struct from being an aggregate.
llvm-svn: 290229
Diffstat (limited to 'clang/test/CodeGenCXX/value-init.cpp')
-rw-r--r-- | clang/test/CodeGenCXX/value-init.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/clang/test/CodeGenCXX/value-init.cpp b/clang/test/CodeGenCXX/value-init.cpp index 735dc616399..fc4e0d3a55e 100644 --- a/clang/test/CodeGenCXX/value-init.cpp +++ b/clang/test/CodeGenCXX/value-init.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 %s -triple x86_64-apple-darwin10 -emit-llvm -o - | FileCheck %s +// RUN: %clang_cc1 -std=c++98 %s -triple x86_64-apple-darwin10 -emit-llvm -o - | FileCheck %s struct A { virtual ~A(); @@ -315,6 +315,14 @@ namespace PR20256 { // CHECK: } } +// CHECK-LABEL: define {{.*}}@_Z20explicitly_defaultedv +int explicitly_defaulted() { + struct A { A() = default; int n; }; + // CHECK: call void @llvm.memset + A a = A(); + return a.n; +} // CHECK-LABEL: } + // CHECK-LABEL: define linkonce_odr void @_ZN8zeroinit2X3IiEC2Ev(%"struct.zeroinit::X3"* %this) unnamed_addr // CHECK: call void @llvm.memset.p0i8.i64 // CHECK-NEXT: call void @_ZN8zeroinit2X2IiEC2Ev |