[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.

Richard Smith - zygoloid via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 11 12:43:11 PDT 2019


rsmith created this revision.
rsmith added a reviewer: rjmccall.
Herald added a subscriber: jdoerfert.
Herald added a project: clang.

When a variable is named in a context where we can't directly emit a
reference to it (because we don't know for sure that it's going to be
defined, or it's from an enclosing function and not captured, or the
reference might not "work" for some reason), we emit a copy of the
variable as a global and use that for the known-to-be-read-only access.


Repository:
  rC Clang

https://reviews.llvm.org/D63157

Files:
  lib/CodeGen/CGDecl.cpp
  lib/CodeGen/CGExpr.cpp
  lib/CodeGen/CodeGenModule.h
  lib/Sema/SemaExpr.cpp
  test/CXX/basic/basic.def.odr/p2.cpp
  test/CXX/drs/dr20xx.cpp
  test/CXX/drs/dr21xx.cpp
  test/CXX/drs/dr23xx.cpp
  test/CXX/drs/dr6xx.cpp
  test/CXX/drs/dr7xx.cpp
  test/CodeGenCXX/no-odr-use.cpp
  www/cxx_dr_status.html

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D63157.204131.patch
Type: text/x-patch
Size: 39012 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190611/6940d4bf/attachment-0001.bin>


More information about the cfe-commits mailing list