https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93211
Bug ID: 93211 Summary: equivalence of dependent function calls doesn't check if the call is eligible for ADL Product: gcc Version: 9.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: vanyacpp at gmail dot com Target Milestone: --- Consider this code: // https://gcc.godbolt.org/z/3U2TTd #include <type_traits> template<typename T> void g(T); template<typename T, decltype(g(T{})) = 0> void f() {} // (1) template<typename T, decltype(::g(T{})) = 0> void f() {} // (2) Question is whether (1) and (2) are (re)definition of the same function or definitions of two different functions. Currently GCC believes that this is a redefinition of the same function. I think (1) and (2) should be definitions of two different functions, because "decltype(g(T{}))" and "decltype(::g(T{}))" are susceptible to different SFINAE errors: the overload candidate set of (2) is fixed and the overload candidate set of (1) can be extended arbitrary by ADL.