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

Jordan Rose jordan_rose at apple.com
Wed Apr 10 15:50:38 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;
----------------
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```



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



More information about the cfe-commits mailing list