summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/Expr.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2013-06-03 07:13:35 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2013-06-03 07:13:35 +0000
commit2d18790b3a201119cd0ca83813be70e3838f3c6d (patch)
treea2900075dac83537f5a3d03112a34a903aa9315d /clang/lib/AST/Expr.cpp
parentf80d72f1492ad0e72fa0f4d5e64ee9297f293d53 (diff)
downloadbcm5719-llvm-2d18790b3a201119cd0ca83813be70e3838f3c6d.tar.gz
bcm5719-llvm-2d18790b3a201119cd0ca83813be70e3838f3c6d.zip
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
Diffstat (limited to 'clang/lib/AST/Expr.cpp')
-rw-r--r--clang/lib/AST/Expr.cpp8
1 files changed, 5 insertions, 3 deletions
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<FieldDecl>(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<BinaryOperator>(E)) {
OpenPOWER on IntegriCloud