[PATCH] Force a load when creating a reference to a temporary copied from a bitfield.
Doug Gregor
dgregor at apple.com
Wed Apr 10 10:47:56 PDT 2013
================
Comment at: lib/Sema/SemaInit.cpp:3383
@@ +3382,3 @@
+ assert(!ICS.isBad());
+ Sequence.AddConversionSequenceStep(ICS, cv1T1);
+ return VK_RValue;
----------------
A conversion sequence step is a fairly heavy way to introduce an lvalue-to-rvalue conversion. Why not add a new InitializationSequence::StepKind that simply maps down to a CK_LValueToRRalue implicit cast? I guess one would still have to potentially add a qualification conversion step, but I'd prefer that simple path over a full ICS.
================
Comment at: lib/AST/ExprConstant.cpp:2869
@@ -2871,1 +2868,3 @@
+ if (E->getType()->isRecordType())
+ return EvaluateTemporary(E->GetTemporaryExpr(), Result, Info);
----------------
Yay!
Dare we kill CodeGen's hackery for this AST brokenness as well?
http://llvm-reviews.chandlerc.com/D651
More information about the cfe-commits
mailing list