[PATCH] D79800: [Sema] Remove default values for arguments prior to a parameter pack if the pack is used

John McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu May 21 23:20:35 PDT 2020


rjmccall added inline comments.


================
Comment at: clang/test/CXX/drs/dr7xx.cpp:225
 template <typename... T>
 void f(int i = 0, T ...args) {}
 void ff() { f(); }
----------------
Quuxplusone wrote:
> Is this even supposed to compile? The only valid specializations of `f` require `T...` to be an empty pack, which violates [temp.res/8.3](https://timsong-cpp.github.io/cppwp/temp.res#8.3).
> 
> The comment mentions [DR777](http://cwg-issue-browser.herokuapp.com/cwg777), but DR777 doesn't explain the circumstances under which its wording change matters. It //seems// only to apply to templates that are already ill-formed by temp.res/8.3.
Yeah, Richard made this point in [[http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#2233|DR2233]], and the wording was weakened to allow it, in a way that essentially makes the earlier default arguments dead.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D79800





More information about the cfe-commits mailing list