Fix thunk generation for thunks with a parameter with reference type.

llvm-svn: 90412
This commit is contained in:
Eli Friedman 2009-12-03 04:49:52 +00:00
parent 551fe84d0e
commit 4039f35344
2 changed files with 9 additions and 1 deletions

View File

@ -940,7 +940,8 @@ CodeGenFunction::GenerateCovariantThunk(llvm::Function *Fn,
QualType ArgType = D->getType();
// llvm::Value *Arg = CGF.GetAddrOfLocalVar(Dst);
Expr *Arg = new (getContext()) DeclRefExpr(D, ArgType, SourceLocation());
Expr *Arg = new (getContext()) DeclRefExpr(D, ArgType.getNonReferenceType(),
SourceLocation());
CallArgs.push_back(std::make_pair(EmitCallArg(Arg, ArgType), ArgType));
}

View File

@ -0,0 +1,7 @@
// RUN: clang-cc -emit-llvm-only %s
struct A { int a; virtual void aa(int&); };
struct B { int b; virtual void bb(int&); };
struct C : A,B { virtual void aa(int&), bb(int&); };
void C::aa(int&) {}
void C::bb(int&) {}