https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100443
--- Comment #6 from gnzlbg <gonzalo.gadeschi at gmail dot com> --- >From [basic.scope.scope]/p3.3.2 http://eel.is/c++draft/basic.scope.scope#3.3.2 I think that A::f and B::f don't correspond because they are function templates but their return types differ. Since they don't correspond, I interpret from [namespace.udecl]/p11 http://eel.is/c++draft/namespace.udecl#11 that the using-declaration must bring A::f into scope, and then the function call is ambiguous in C++ > 20. In C++20 and earlier this example seems legal.