]> granicus.if.org Git - clang/commitdiff
Fixed a ir-gen bug in synthesizing copy constructors.
authorFariborz Jahanian <fjahanian@apple.com>
Mon, 10 Aug 2009 17:20:45 +0000 (17:20 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Mon, 10 Aug 2009 17:20:45 +0000 (17:20 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78570 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGCXX.cpp
test/CodeGenCXX/copy-constructor-synthesis.cpp

index c16ca3661c9b320a7acf78dce7d9a878d532fb96..55693d1073d945795ecf8dd0b9e61145b880ddc9 100644 (file)
@@ -784,7 +784,7 @@ void CodeGenFunction::EmitClassMemberwiseCopy(
     
     // Push the Src ptr.
     CallArgs.push_back(std::make_pair(RValue::get(Src),
-                                      BaseCopyCtor->getThisType(getContext())));
+                       BaseCopyCtor->getParamDecl(0)->getType()));
     QualType ResultType = 
     BaseCopyCtor->getType()->getAsFunctionType()->getResultType();
     EmitCall(CGM.getTypes().getFunctionInfo(ResultType, CallArgs),
index edc0c0ecb8294759605d97f10d023a9964fb15d8..a993926f190b4ccb4a1cd3daf23e8332bbc06879 100644 (file)
@@ -1,5 +1,5 @@
-// RUNX: clang-cc -triple x86_64-apple-darwin -S %s -o %t-64.s &&
-// RUNX: FileCheck -check-prefix LP64 --input-file=%t-64.s %s &&
+// RUN: clang-cc -triple x86_64-apple-darwin -S %s -o %t-64.s &&
+// RUN: FileCheck -check-prefix LP64 --input-file=%t-64.s %s &&
 // RUN: clang-cc -triple i386-apple-darwin -S %s -o %t-32.s &&
 // RUN: FileCheck -check-prefix LP32 --input-file=%t-32.s %s &&
 // RUN: true
@@ -43,12 +43,9 @@ int main()
        X c(x);
         c.pr();
 }
-#if 0
-// -m64 does not work due to unrelated llvm bug!
 // CHECK-LP64: .globl  __ZN1XC1ERK1X
 // CHECK-LP64: .weak_definition __ZN1XC1ERK1X
 // CHECK-LP64: __ZN1XC1ERK1X:
-#endif
 
 // CHECK-LP32: .globl  __ZN1XC1ERK1X
 // CHECK-LP32: .weak_definition __ZN1XC1ERK1X