diff --git a/gcc/cp/name-lookup.c b/gcc/cp/name-lookup.c index 3bce3d597dc..4e84e2f9987 100644 --- a/gcc/cp/name-lookup.c +++ b/gcc/cp/name-lookup.c @@ -5520,7 +5520,7 @@ push_class_level_binding_1 (tree name, tree x) old_decl = bval; else if (TREE_CODE (bval) == USING_DECL && OVL_P (target_decl)) - return true; + old_decl = bval; else if (OVL_P (target_decl) && OVL_P (target_bval)) old_decl = bval; diff --git a/gcc/testsuite/g++.dg/lookup/using66.C b/gcc/testsuite/g++.dg/lookup/using66.C new file mode 100644 index 00000000000..02383bbea3e --- /dev/null +++ b/gcc/testsuite/g++.dg/lookup/using66.C @@ -0,0 +1,23 @@ +// PR c++/92918 +// { dg-do compile { target c++11 } } + +struct Base03 +{ + static void impl(); +}; + +struct Problem : Base03 +{ + using Base03::impl; + static int impl(char const *); + + template + auto f(const T &t) const + -> decltype(impl(t)) + { + return impl(t); + } +}; + +Problem t; +int i = t.f("42");