[Bug c++/93211] New: equivalence of dependent function calls doesn't check if the call is eligible for ADL

vanyacpp at gmail dot com gcc-bugzilla@gcc.gnu.org
Thu Jan 9 14:09:00 GMT 2020


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.


More information about the Gcc-bugs mailing list