[PATCH] D56066: [OpenCL] Address space for default class members

John McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 10 11:43:39 PST 2019


rjmccall added inline comments.


================
Comment at: lib/AST/Expr.cpp:1618
     assert(getValueKindForType(Ty) == Expr::getValueKindForType(SETy));
-    if (!isGLValue())
+    if (!isGLValue() && !getSubExpr()->isXValue()) {
       Ty = Ty->getPointeeType();
----------------
What's this about?  I would expect that the VK of this and its sub-expression are always the same.


================
Comment at: lib/CodeGen/CGExprAgg.cpp:813
+  case CK_AddressSpaceConversion: {
+    Visit(E->getSubExpr());
+    break;
----------------
If there's a `Dest`, you might need to reverse-convert its address space, right?


================
Comment at: lib/Sema/SemaInit.cpp:4686
+      Sequence.AddQualificationConversionStep(cv1AST4, ValueKind);
+    }
     ValueKind = isLValueRef ? VK_LValue : VK_XValue;
----------------
Okay.  The existing behavior seems a little strange, but, well, it's existing behavior.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D56066/new/

https://reviews.llvm.org/D56066





More information about the cfe-commits mailing list