[PATCH] D133683: [c++] implements tentative DR1432 for partial ordering of function template

Yuanfang Chen via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 27 13:12:09 PDT 2022


ychen added a comment.

In D133683#3819003 <https://reviews.llvm.org/D133683#3819003>, @mizvekov wrote:

> In D133683#3818935 <https://reviews.llvm.org/D133683#3818935>, @ychen wrote:
>
>> This is described in https://eel.is/c++draft/temp.deduct.partial#13. Parietal ordering currently doesn't consider the number of deduced arguments. During the partial ordering stage, by https://eel.is/c++draft/temp.func.order#3, `template <typename T, typename... U> void g(T, U...);` would become `void g(UniqueT1, UniqueT2);`. And then it applies https://eel.is/c++draft/temp.deduct.partial#3.1 to decide which parameters are compared for partial ordering.
>
> Sure, one thing is, given that we deduced a pack, does the number of elements deduced for that pack matter in partial ordering. I think `temp.deduct.partial#13` answers that it doesn't.
>
> The other thing is, is a given template parameter pack used, or deduced, as opposed to just not being used. and I think the answer here is yes for that second overload of `g`.
>
> If a template parameter pack appears as a type of a function parameter in an expansion pattern, such as `void g(T, U...);`, then I think that, notionally, there is no way to not use it.

That's right. That requires the wording says something like `pack is always used for partial ordering`. I just realized that this `g(42)` example is from https://eel.is/c++draft/temp.func.order#note-3.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D133683



More information about the cfe-commits mailing list