public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/106493] New: trailing requires clauses is not used for partial ordering when the ellipsis parameter is present
@ 2022-08-01  0:59 tabloid.adroit at gmail dot com
  2022-08-01  2:23 ` [Bug c++/106493] " pinskia at gcc dot gnu.org
  2022-08-01  4:49 ` tabloid.adroit at gmail dot com
  0 siblings, 2 replies; 3+ messages in thread
From: tabloid.adroit at gmail dot com @ 2022-08-01  0:59 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106493

            Bug ID: 106493
           Summary: trailing requires clauses is not used for partial
                    ordering when the ellipsis parameter is present
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: tabloid.adroit at gmail dot com
  Target Milestone: ---

test case:

```
  template<typename T>
  concept AtLeast2 = sizeof(T) >= 2;

  template<typename T>
  constexpr int doo(int a, ...) requires AtLeast2<int> && true {
    return 1;
  }

  template<typename T>
  constexpr int doo(int b) requires AtLeast2<int> {
    return 2;
  }

  static_assert(doo<int>(2) == 1);
```

The assertion fails due to ambiguity. However, I'd expect the trailing requires
clauses kicks in by https://eel.is/c++draft/temp.fct#temp.func.order-6.4

Removing the ellipsis parameter fixes the assertion failure.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug c++/106493] trailing requires clauses is not used for partial ordering when the ellipsis parameter is present
  2022-08-01  0:59 [Bug c++/106493] New: trailing requires clauses is not used for partial ordering when the ellipsis parameter is present tabloid.adroit at gmail dot com
@ 2022-08-01  2:23 ` pinskia at gcc dot gnu.org
  2022-08-01  4:49 ` tabloid.adroit at gmail dot com
  1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-08-01  2:23 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106493

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
clang rejects this for the same reason ...

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug c++/106493] trailing requires clauses is not used for partial ordering when the ellipsis parameter is present
  2022-08-01  0:59 [Bug c++/106493] New: trailing requires clauses is not used for partial ordering when the ellipsis parameter is present tabloid.adroit at gmail dot com
  2022-08-01  2:23 ` [Bug c++/106493] " pinskia at gcc dot gnu.org
@ 2022-08-01  4:49 ` tabloid.adroit at gmail dot com
  1 sibling, 0 replies; 3+ messages in thread
From: tabloid.adroit at gmail dot com @ 2022-08-01  4:49 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106493

--- Comment #2 from Yuanfang Chen <tabloid.adroit at gmail dot com> ---
I'm actually fixing it on the Clang side. It would be great to make GCC/Clang
match each other.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-08-01  4:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-01  0:59 [Bug c++/106493] New: trailing requires clauses is not used for partial ordering when the ellipsis parameter is present tabloid.adroit at gmail dot com
2022-08-01  2:23 ` [Bug c++/106493] " pinskia at gcc dot gnu.org
2022-08-01  4:49 ` tabloid.adroit at gmail dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).