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

--- Comment #3 from waffl3x <waffl3x at protonmail dot com> ---
(In reply to Patrick Palka from comment #1)
> Confirmed.  This bug also affects ordinary static member functions:
> 
Nice, good find.

(In reply to Patrick Palka from comment #2)
> > As far as I know, these functions shouldn't even be being instantiated yet, 
> > yet they appear to be.
> It's not required by the standard, but GCC checks non-dependent expressions
> ahead of time in order to proactively diagnose IFNDR template definitions
> that could never produce a valid specialization ([temp.res.general]/6).  So
> I guess it boils down to whether f<char> is considered type-dependent?  I
> don't think it is, at least according to [temp.res.expr]/3, so we should in
> theory be able to check the call ahead of time, but it seems something is
> going wrong after we partially substitute the explicit template arguments
> {char} into the template during template argument deduction.

Ah gotcha, that's definitely preferable, for some reason I had thought
GCC doesn't do that. Just a misunderstanding on my part then.

I am a little surprised it isn't considered type dependent, but I can't
come up with a case that causes problems. I couldn't find
[temp.res.expr], did you mean [temp.dep.expr] instead?

In any case, unless I can come up with a case that causes something to
misbehave, I agree that the early error is not a bug in itself.

Reply via email to