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

--- Comment #6 from Jason Merrill <jason at gcc dot gnu.org> ---
(In reply to Nathan Sidwell from comment #5)
> template <typename T> int Foo (T);
> 
> template <int> class TPL;
> 
> template <int I>
> constexpr TPL<Foo (I)> Foo (); // #1
> 
> template <int I>
> constexpr TPL<Foo (I)> Foo (); // #2
> 
> What I think is happening is that the definition at #1 changes the overload
> set to which 'Foo' binds.  Thus in #2 the 'Foo (I)' finds something
> different.  I don't think we prune the overload set until later?

Hmm, I think we shouldn't be binding Foo at all, it's a dependent name. 17.6.2:

Such names are unbound and are looked up at the point of the template
instantiation (17.6.4.1) in both the context of the template definition and the
context of the point of instantiation.

Reply via email to