]> gcc.gnu.org Git - gcc.git/commitdiff
c++: tweak PR105006 fix
authorJason Merrill <jason@redhat.com>
Wed, 23 Mar 2022 16:22:20 +0000 (12:22 -0400)
committerJason Merrill <jason@redhat.com>
Wed, 23 Mar 2022 17:17:35 +0000 (13:17 -0400)
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.

gcc/cp/name-lookup.cc

index ea947fabb7ef60be9276c0d2b7fdcffa84f76ce7..3c7b626350f458b22f047c2b121a4fe12055b4b6 100644 (file)
@@ -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))
This page took 0.064311 seconds and 5 git commands to generate.