[cfe-commits] r133618 - in /cfe/trunk: include/clang/AST/ExprCXX.h lib/Sema/SemaInit.cpp
Douglas Gregor
dgregor at apple.com
Wed Jun 22 08:05:03 PDT 2011
Author: dgregor
Date: Wed Jun 22 10:05:02 2011
New Revision: 133618
URL: http://llvm.org/viewvc/llvm-project?rev=133618&view=rev
Log:
Give MaterializeTemporaryExpr the exact type of the lvalue it binds
to, including cv-qualifications.
Modified:
cfe/trunk/include/clang/AST/ExprCXX.h
cfe/trunk/lib/Sema/SemaInit.cpp
Modified: cfe/trunk/include/clang/AST/ExprCXX.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/ExprCXX.h?rev=133618&r1=133617&r2=133618&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/ExprCXX.h (original)
+++ cfe/trunk/include/clang/AST/ExprCXX.h Wed Jun 22 10:05:02 2011
@@ -3013,8 +3013,9 @@
friend class ASTStmtWriter;
public:
- MaterializeTemporaryExpr(Expr *Temporary, bool BoundToLvalueReference)
- : Expr(MaterializeTemporaryExprClass, Temporary->getType(),
+ MaterializeTemporaryExpr(QualType T, Expr *Temporary,
+ bool BoundToLvalueReference)
+ : Expr(MaterializeTemporaryExprClass, T,
BoundToLvalueReference? VK_LValue : VK_XValue, OK_Ordinary,
Temporary->isTypeDependent(), Temporary->isValueDependent(),
Temporary->containsUnexpandedParameterPack()),
Modified: cfe/trunk/lib/Sema/SemaInit.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaInit.cpp?rev=133618&r1=133617&r2=133618&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaInit.cpp (original)
+++ cfe/trunk/lib/Sema/SemaInit.cpp Wed Jun 22 10:05:02 2011
@@ -4080,7 +4080,9 @@
return ExprError();
// Materialize the temporary into memory.
- CurInit = new (S.Context) MaterializeTemporaryExpr(CurInit.get(),
+ CurInit = new (S.Context) MaterializeTemporaryExpr(
+ Entity.getType().getNonReferenceType(),
+ CurInit.get(),
Entity.getType()->isLValueReferenceType());
break;
More information about the cfe-commits
mailing list