From: Jason Merrill Date: Thu, 17 Feb 2022 23:11:23 +0000 (-0500) Subject: Revert "c++: using overloaded with local decl [PR92918]" X-Git-Tag: releases/gcc-10.4.0~404 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b4e92ae2cacb0ef539326249fc59f790423a0766;p=thirdparty%2Fgcc.git Revert "c++: using overloaded with local decl [PR92918]" PR c++/104476 This reverts commit decd38f99dd05eb54ddcaee7c52f21a56a844613. --- diff --git a/gcc/cp/name-lookup.c b/gcc/cp/name-lookup.c index f8caa16fc762..533d79542c93 100644 --- a/gcc/cp/name-lookup.c +++ b/gcc/cp/name-lookup.c @@ -4552,7 +4552,7 @@ push_class_level_binding_1 (tree name, tree x) old_decl = bval; else if (TREE_CODE (bval) == USING_DECL && OVL_P (target_decl)) - old_decl = bval; + return true; 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 deleted file mode 100644 index 02383bbea3e0..000000000000 --- a/gcc/testsuite/g++.dg/lookup/using66.C +++ /dev/null @@ -1,23 +0,0 @@ -// 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");