[Bug c++/107255] declaration and definition of a template function which vary in use of concept auto syntax are interpreted as ambiguous overloads

redi at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Sat Oct 15 13:33:01 GMT 2022


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

--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Jiang An from comment #1)
> I think two declarations are functionally-equivalent but not equivalent.

Yes, I think you're right. Similarly, these are not equivalent despite looking
superficially the same:

template <class F> requires Foo<F>
void bar(F) {}

template <class F>
void bar(F) requires Foo<F> {}

(Lookup for "Foo" actually considers different scopes in these two cases.)


More information about the Gcc-bugs mailing list