[PATCH] D81615: [clang] CWG 2082 and 2346: loosen the restrictions on parameters and local variables in default arguments.

Bruno Ricci via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 10 15:02:39 PDT 2020


riccibruno created this revision.
riccibruno added reviewers: bkramer, rjmccall, rsmith, erichkeane.
riccibruno added a project: clang.
Herald added a subscriber: cfe-commits.

This patch implements the resolution of  CWG 2082 and CWG 2346.

The resolution of CWG 2082 changed [dcl.fct.default]p7 and p9 to allow a parameter
or local variable to appear in a default argument if not in a potentially-evaluated expression.

The resolution of CWG 2346 changed [dcl.fct.default]p7 to allow a local variable
to appear in a default argument if not odr-used.

An issue remains after this patch (see the FIXME in `test/CXX/dcl.decl/dcl.meaning/dcl.fct.default/p7.cpp`).
This is addressed by the next patch.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D81615

Files:
  clang/lib/Sema/SemaDeclCXX.cpp
  clang/test/CXX/dcl.decl/dcl.meaning/dcl.fct.default/p7.cpp
  clang/test/CXX/dcl.decl/dcl.meaning/dcl.fct.default/p8.cpp
  clang/test/CXX/dcl.decl/dcl.meaning/dcl.fct.default/p9.cpp
  clang/test/CXX/drs/dr20xx.cpp
  clang/test/CXX/drs/dr23xx.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D81615.269972.patch
Type: text/x-patch
Size: 5881 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200610/46c976cb/attachment.bin>


More information about the cfe-commits mailing list