public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/107429] New: misdiagnosed "constraint depends on itself" in overloaded functions
@ 2022-10-26 21:03 jwjagersma at gmail dot com
  2022-10-27 12:42 ` [Bug c++/107429] " ppalka at gcc dot gnu.org
  2022-10-27 16:16 ` jwjagersma at gmail dot com
  0 siblings, 2 replies; 3+ messages in thread
From: jwjagersma at gmail dot com @ 2022-10-26 21:03 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 107429
           Summary: misdiagnosed "constraint depends on itself" in
                    overloaded functions
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jwjagersma at gmail dot com
  Target Milestone: ---

Given the following code:

  struct tag_foo { } inline constexpr foo;
  struct tag_bar { } inline constexpr bar;

  template<typename... T>
  auto f(tag_foo, T... x)
  {
    return (x + ...);
  }

  template<typename... T>
  concept fooable = requires (T... x) { f(foo, x...); };

  template<typename... T> requires (fooable<T...>)
  auto f(tag_bar, T... x)
  {
    return f(foo, x...);
  }

  auto test()
  {
    return f(bar, 1, 2, 3);
  }

g++ claims that "satisfaction of atomic constraint [...] depends on itself",
but the overload of 'f()' that is checked by 'fooable' is not constrained in
any way.

I am not 100% sure if this is valid code, but clang and msvc do not make the
same complaint, so I'm inclined to believe g++ is in error here.

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

end of thread, other threads:[~2022-10-27 16:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-26 21:03 [Bug c++/107429] New: misdiagnosed "constraint depends on itself" in overloaded functions jwjagersma at gmail dot com
2022-10-27 12:42 ` [Bug c++/107429] " ppalka at gcc dot gnu.org
2022-10-27 16:16 ` jwjagersma 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).