[PATCH] D63157: C++ DR712 and others: handle non-odr-use resulting from an lvalue-to-rvalue conversion applied to a member access or similar not-quite-trivial lvalue expression.
John McCall via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Jun 12 11:32:51 PDT 2019
rjmccall added inline comments.
================
Comment at: lib/CodeGen/CGExpr.cpp:1429
+/// for instance if a block or lambda or a member of a local class uses a
+/// const int variable or constexpr variable from an enclosing function.
CodeGenFunction::ConstantEmission
----------------
Isn't the old comment correct here? This is mandatory because of the enclosing-local-scope issues; that might be an "optimization" in the language, but it's not an optimization at the IRGen level because Sema literally is forcing us to do it.
================
Comment at: lib/Sema/SemaExpr.cpp:15808
+namespace {
+// Helper to copy the template arguments from a DeclRefExpr or MemberExpr.
+class CopiedTemplateArgs {
----------------
This is really cute; I might steal this idea. That said, it's probably worth explaining the lifetime mechanics here so that non-experts can understand how this works.
Repository:
rC Clang
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D63157/new/
https://reviews.llvm.org/D63157
More information about the cfe-commits
mailing list