зеркало из https://github.com/microsoft/clang-1.git
Fix for PR5524: make reference binding in default argument work correctly.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91733 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
e12e77bed1
Коммит
27a9b72bf1
|
@ -97,7 +97,10 @@ RValue CodeGenFunction::EmitReferenceBindingToExpr(const Expr* E,
|
|||
bool IsInitializer) {
|
||||
bool ShouldDestroyTemporaries = false;
|
||||
unsigned OldNumLiveTemporaries = 0;
|
||||
|
||||
|
||||
if (const CXXDefaultArgExpr *DAE = dyn_cast<CXXDefaultArgExpr>(E))
|
||||
E = DAE->getExpr();
|
||||
|
||||
if (const CXXExprWithTemporaries *TE = dyn_cast<CXXExprWithTemporaries>(E)) {
|
||||
ShouldDestroyTemporaries = true;
|
||||
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
// RUN: %clang_cc1 %s -emit-llvm-only -verify
|
||||
|
||||
struct A {};
|
||||
struct B : A {};
|
||||
void a(const A& x = B());
|
||||
void b() { a(); }
|
Загрузка…
Ссылка в новой задаче