diff options
author | Jason Merrill <jason@redhat.com> | 2022-03-23 12:22:20 -0400 |
---|---|---|
committer | Jason Merrill <jason@redhat.com> | 2022-03-23 13:17:35 -0400 |
commit | e8cd3edc0fc6c02a732dcecf519c22d835e5f422 (patch) | |
tree | 081daccac245403965fea15de3bdc84468653fc0 | |
parent | 5e33fea21957c97d63e3738be6056ae2a94e3284 (diff) | |
download | gcc-e8cd3edc0fc6c02a732dcecf519c22d835e5f422.zip gcc-e8cd3edc0fc6c02a732dcecf519c22d835e5f422.tar.gz gcc-e8cd3edc0fc6c02a732dcecf519c22d835e5f422.tar.bz2 |
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.
-rw-r--r-- | gcc/cp/name-lookup.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/cp/name-lookup.cc b/gcc/cp/name-lookup.cc index ea947fa..3c7b626 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)) |