diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2013-06-03 07:13:35 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2013-06-03 07:13:35 +0000 |
commit | 2d18790b3a201119cd0ca83813be70e3838f3c6d (patch) | |
tree | a2900075dac83537f5a3d03112a34a903aa9315d /clang/lib/AST/Expr.cpp | |
parent | f80d72f1492ad0e72fa0f4d5e64ee9297f293d53 (diff) | |
download | bcm5719-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.cpp | 8 |
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)) { |