From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2122) id A1ABA3842435; Wed, 23 Mar 2022 17:17:52 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A1ABA3842435 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Jason Merrill To: gcc-cvs@gcc.gnu.org Subject: [gcc r12-7788] c++: tweak PR105006 fix X-Act-Checkin: gcc X-Git-Author: Jason Merrill X-Git-Refname: refs/heads/master X-Git-Oldrev: 5e33fea21957c97d63e3738be6056ae2a94e3284 X-Git-Newrev: e8cd3edc0fc6c02a732dcecf519c22d835e5f422 Message-Id: <20220323171752.A1ABA3842435@sourceware.org> Date: Wed, 23 Mar 2022 17:17:52 +0000 (GMT) X-BeenThere: gcc-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Mar 2022 17:17:52 -0000 https://gcc.gnu.org/g:e8cd3edc0fc6c02a732dcecf519c22d835e5f422 commit r12-7788-ge8cd3edc0fc6c02a732dcecf519c22d835e5f422 Author: Jason Merrill Date: Wed Mar 23 12:22:20 2022 -0400 c++: tweak PR105006 fix Checking dependent_type_p avoids needing to walk the overloads in cases where it would not be possible to find a dependent using. PR c++/105006 gcc/cp/ChangeLog: * name-lookup.cc (lookup_using_decl): Check that scope is a dependent type before looking for dependent using. Diff: --- gcc/cp/name-lookup.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/cp/name-lookup.cc b/gcc/cp/name-lookup.cc index ea947fabb7e..3c7b626350f 100644 --- a/gcc/cp/name-lookup.cc +++ b/gcc/cp/name-lookup.cc @@ -5667,7 +5667,7 @@ lookup_using_decl (tree scope, name_lookup &lookup) /* If the lookup in the base contains a dependent using, this using is also dependent. */ - if (!dependent_p && lookup.value) + if (!dependent_p && lookup.value && dependent_type_p (scope)) { tree val = lookup.value; if (tree fns = maybe_get_fns (val))