[PATCH] Force a load when creating a reference to a temporary copied from a bitfield.

Doug Gregor dgregor at apple.com
Wed Apr 10 15:51:50 PDT 2013



================
Comment at: lib/Sema/SemaInit.cpp:3402
@@ +3401,3 @@
+    // Force a load so we can materialize a temporary.
+    Sequence.AddLValueToRValueStep(cv1T1.getUnqualifiedType());
+    return VK_RValue;
----------------
Jordan Rose wrote:
> Doug Gregor wrote:
> > Might we need a qualification conversion step after this?
> I saw that the first time around, but it looks like rvalues are never qualified:
> 
> ```const int &ref = 1;```
> 
> 
> 
> ```VarDecl [...] ref 'const int &'
> |-MaterializeTemporaryExpr [...] 'const int' lvalue
>   |-IntegerLiteral [...] 'int' 1```
> 
Right, prvalues of scalar type are unqualified. Okay, LGTM!


http://llvm-reviews.chandlerc.com/D651



More information about the cfe-commits mailing list