aboutsummaryrefslogtreecommitdiff
path: root/clang/test/CodeGenCXX/constructor-init.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-12-19 03:01:41 +0000
committerDouglas Gregor <dgregor@apple.com>2009-12-19 03:01:41 +0000
commita4b592a7d5892001b53f51fe936c77d340e6df38 (patch)
treeed409ff8cc553a6b1fba5db61af72bbefc8e0c8d /clang/test/CodeGenCXX/constructor-init.cpp
parent04cc307eddae4681709cb4f019e5f9363e0506c3 (diff)
downloadllvm-a4b592a7d5892001b53f51fe936c77d340e6df38.zip
llvm-a4b592a7d5892001b53f51fe936c77d340e6df38.tar.gz
llvm-a4b592a7d5892001b53f51fe936c77d340e6df38.tar.bz2
Switch more of Sema::CheckInitializerTypes over to
InitializationSequence. Specially, switch initialization of a C++ class type (either copy- or direct-initialization). Also, make sure that we create an elidable copy-construction when performing copy initialization of a C++ class variable. Fixes PR5826. llvm-svn: 91750
Diffstat (limited to 'clang/test/CodeGenCXX/constructor-init.cpp')
-rw-r--r--clang/test/CodeGenCXX/constructor-init.cpp23
1 files changed, 22 insertions, 1 deletions
diff --git a/clang/test/CodeGenCXX/constructor-init.cpp b/clang/test/CodeGenCXX/constructor-init.cpp
index ae6014f..a0a35fa 100644
--- a/clang/test/CodeGenCXX/constructor-init.cpp
+++ b/clang/test/CodeGenCXX/constructor-init.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 %s -emit-llvm -o %t
+// RUN: %clang_cc1 -triple x86_64-apple-darwin10 %s -emit-llvm -o - | FileCheck %s
extern "C" int printf(...);
@@ -59,3 +59,24 @@ int main() {
n1.PR();
}
+// PR5826
+template <class T> struct A {
+ A() {}
+ A(int) {}
+ A(const A&) {}
+ ~A() {}
+ operator int() {return 0;}
+};
+
+// CHECK: define void @_Z1fv()
+void f() {
+ // CHECK: call void @_ZN1AIsEC1Ei
+ A<short> a4 = 97;
+
+ // CHECK-NEXT: store i32 17
+ int i = 17;
+
+ // CHECK-NEXT: call void @_ZN1AIsED1Ev
+ // CHECK-NOT: call void @_ZN1AIsED1Ev
+ // CHECK: ret void
+}