From 2d18790b3a201119cd0ca83813be70e3838f3c6d Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Mon, 3 Jun 2013 07:13:35 +0000 Subject: Do not walk through member-accesses on bitfields when looking for the object which is lifetime-extended by a reference binding. An additional temporary is created for such a bitfield access (although we have no explicit AST representation for it). llvm-svn: 183095 --- clang/lib/AST/Expr.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'clang/lib/AST/Expr.cpp') diff --git a/clang/lib/AST/Expr.cpp b/clang/lib/AST/Expr.cpp index 2a9b9eb4534..db4269bf163 100644 --- a/clang/lib/AST/Expr.cpp +++ b/clang/lib/AST/Expr.cpp @@ -76,9 +76,11 @@ const Expr *Expr::skipRValueSubobjectAdjustments( if (!ME->isArrow() && ME->getBase()->isRValue()) { assert(ME->getBase()->getType()->isRecordType()); if (FieldDecl *Field = dyn_cast(ME->getMemberDecl())) { - E = ME->getBase(); - Adjustments.push_back(SubobjectAdjustment(Field)); - continue; + if (!Field->isBitField()) { + E = ME->getBase(); + Adjustments.push_back(SubobjectAdjustment(Field)); + continue; + } } } } else if (const BinaryOperator *BO = dyn_cast(E)) { -- cgit v1.2.3