[PATCH] D128745: [c++] implements DR692, DR1395 and tentatively DR1432, about partial ordering of variadic template partial specialization or function template

Yuanfang Chen via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 4 11:54:22 PDT 2022


ychen added a comment.

In D128745#3834454 <https://reviews.llvm.org/D128745#3834454>, @tahonermann wrote:

> Is it known what gcc and Microsoft maintainers are going to do with these DRs? I don't see any recent changes in gcc, but the following is interesting...

It's hard to tell if they didn't implement these DRs or if they're broken. But for P2113 <https://reviews.llvm.org/P2113> (C++20) to work, DR692 is needed.

> For the test below, Clang has historically accepted it but now rejects it. MSVC has historically rejected it, but started accepting it for v19.34 (perhaps a regression?). Gcc continues to accept it. See https://godbolt.org/z/jax3GsYY5.
>
>   struct map {
>     template <typename Sequence>
>     map(Sequence&& seq , void* = 0 );
>     template <typename First, typename ...T_>
>     map(First&& first, T_&&... rest);
>   };
>   map m(0);

This should be ambiguous. Only the first parameter should be considered for partial ordering. This is basically the `g(42)` example in https://eel.is/c++draft/temp.func.order#example-4.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D128745



More information about the cfe-commits mailing list