https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109018
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution|--- |INVALID --- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> --- >gives this example about dependent expression lookup issue. Yes and it explictly it is about an invalid code example which GCC gets correct. The comment here: // template argument substitution fails; g(int) // was not in scope at the first declaration of h() Explictly saying this code is invalid. If you used a non-base type. ADL will find the g correctly in the substitution of T. E.g. this is valid: ``` struct A{}; template<class T> decltype(g(T())) h(); int g(A); template<class T> decltype(g(T())) h() return g(T());} int i = h<A>(); ``` >Both clang and MSVC can solve this with no issue. Yes and clang and MSVC has a bug then.