summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaExpr.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2016-12-03 01:14:32 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2016-12-03 01:14:32 +0000
commit4baaa5ab52870c3d2e1961aaa7758908ea69579e (patch)
treed0b7a59ca83d21a73fbd5a907b01941e9199da31 /clang/lib/Sema/SemaExpr.cpp
parent05049bed027cb37ef4afcbc6b280603e767f7971 (diff)
downloadbcm5719-llvm-4baaa5ab52870c3d2e1961aaa7758908ea69579e.tar.gz
bcm5719-llvm-4baaa5ab52870c3d2e1961aaa7758908ea69579e.zip
DR616, and part of P0135R1: member access (or pointer-to-member access) on a
temporary produces an xvalue, not a prvalue. Support this by materializing the temporary prior to performing the member access. llvm-svn: 288563
Diffstat (limited to 'clang/lib/Sema/SemaExpr.cpp')
-rw-r--r--clang/lib/Sema/SemaExpr.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp
index 667ea6cb4e3..4415100ab45 100644
--- a/clang/lib/Sema/SemaExpr.cpp
+++ b/clang/lib/Sema/SemaExpr.cpp
@@ -9810,8 +9810,8 @@ static bool IsReadonlyMessage(Expr *E, Sema &S) {
const MemberExpr *ME = dyn_cast<MemberExpr>(E);
if (!ME) return false;
if (!isa<FieldDecl>(ME->getMemberDecl())) return false;
- ObjCMessageExpr *Base =
- dyn_cast<ObjCMessageExpr>(ME->getBase()->IgnoreParenImpCasts());
+ ObjCMessageExpr *Base = dyn_cast<ObjCMessageExpr>(
+ ME->getBase()->IgnoreImplicit()->IgnoreParenImpCasts());
if (!Base) return false;
return Base->getMethodDecl() != nullptr;
}
@@ -9894,7 +9894,7 @@ static void DiagnoseConstAssignment(Sema &S, const Expr *E,
while (true) {
IsDereference = NextIsDereference;
- E = E->IgnoreParenImpCasts();
+ E = E->IgnoreImplicit()->IgnoreParenImpCasts();
if (const MemberExpr *ME = dyn_cast<MemberExpr>(E)) {
NextIsDereference = ME->isArrow();
const ValueDecl *VD = ME->getMemberDecl();
OpenPOWER on IntegriCloud