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

--- Comment #5 from Tom Honermann <tom at honermann dot net> ---
(In reply to Andrew Sutton from comment #3)
> Function concepts have some parsing issues related to TS-style terse
> notation, overloading and variadic templates. In particular, there are
> places where writing C<T> forms a (possibly) syntactically valid placeholder
> C<?, T> as part of a functional cast expression, which leads to the error
> you're seeing: you're incompletely instantiating a template-id that resolved
> to the template with two parameters.

I was going to argue that that explanation didn't explain why the reported
diagnostic doesn't occur when the order of the overload declarations are
swapped.  However, I did a quick test and found that, indeed, the diagnostic is
not issued for the swapped case in gcc 6.1.0, but is in gcc 6.3, 7.1, and
later.  It seems the lack of a diagnostic in that case was some other issue
that has since been fixed.

(In reply to Jonathan Wakely from comment #4)
> I think the "conflicts with a previous declaration" diagnostic is
> reasonable. Maybe "redeclared as a different kind of symbol" would also work.

I agree the diagnostics for the C++20 case are appropriate.  I don't have an
opinion on whether it is worth trying to improve them further.

> I'll recategorise it as a diagnostic enhancement and confirm it, but I think
> closing it would also be fine.

As the original reported, I'm ok with this being closed since the original
issue isn't relevant for C++20 concepts.  I don't recall the situation that
caused me to trip over this issue in the first place.  I suspect I was just
playing around with the interaction between constexpr and concept functions.

Reply via email to