Skip to content

Commit c2d71b5

Browse files
author
Fariborz Jahanian
committed
This patch fixes code gen. part of pr5333 (Conversion
using elipsis conversion). llvm-svn: 86276
1 parent 8a65129 commit c2d71b5

File tree

2 files changed

+27
-1
lines changed

2 files changed

+27
-1
lines changed

clang/lib/CodeGen/CGCXX.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -649,8 +649,10 @@ void CodeGenModule::EmitCXXConstructor(const CXXConstructorDecl *D,
649649
llvm::Function *
650650
CodeGenModule::GetAddrOfCXXConstructor(const CXXConstructorDecl *D,
651651
CXXCtorType Type) {
652+
const FunctionProtoType *FPT = D->getType()->getAs<FunctionProtoType>();
652653
const llvm::FunctionType *FTy =
653-
getTypes().GetFunctionType(getTypes().getFunctionInfo(D), false);
654+
getTypes().GetFunctionType(getTypes().getFunctionInfo(D),
655+
FPT->isVariadic());
654656

655657
const char *Name = getMangledCXXCtorName(D, Type);
656658
return cast<llvm::Function>(
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// RUN: clang-cc -triple x86_64-apple-darwin -std=c++0x -emit-llvm %s -o %t-64.ll &&
2+
// RUN: FileCheck -check-prefix LPLL64 --input-file=%t-64.ll %s &&
3+
// RUN: true
4+
5+
extern "C" int printf(...);
6+
7+
struct A {
8+
A(...) {
9+
printf("A::A(...)\n");
10+
}
11+
};
12+
13+
A a(1.34);
14+
15+
A b = 2.34;
16+
17+
int main()
18+
{
19+
A c[3];
20+
}
21+
22+
// CHECK-LPLL64: call void (%struct.A*, ...)
23+
// CHECK-LPLL64: call void (%struct.A*, ...)
24+
// CHECK-LPLL64: call void (%struct.A*, ...)

0 commit comments

Comments
 (0)