[PATCH] D49508: [CodeGen] VisitMaterializeTemporaryExpr(): don't skip NoOp Casts.

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 18 14:26:11 PDT 2018


efriedma added a comment.

skipRValueSubobjectAdjustments has to match the rules in `[class.temporary]` in the standard, which includes skipping over certain explicit casts.

Would it be enough to accumulate the skipped casts into a SmallVector, like we do for the skipped comma operators?



================
Comment at: test/CodeGenCXX/const-init-cxx11.cpp:229
   // This creates a non-const temporary and binds a reference to it.
-  // CHECK: @[[TEMP:.*]] = internal global {{.*}} { i32 5 }, align 4
+  // CHECK: @[[TEMP:.*]] = internal constant {{.*}} { i32 5 }, align 4
   // CHECK: @_ZN16LiteralReference3litE = constant {{.*}} @[[TEMP]], align 8
----------------
This change is suspect; note the comment "this creates a non-const temporary".


Repository:
  rC Clang

https://reviews.llvm.org/D49508





More information about the llvm-commits mailing list