https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105006
--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Jason Merrill <ja...@gcc.gnu.org>: https://gcc.gnu.org/g:a3f78748fab6b24e3d4a8b319afd3f8afa17248f commit r12-7784-ga3f78748fab6b24e3d4a8b319afd3f8afa17248f Author: Jason Merrill <ja...@redhat.com> Date: Tue Mar 22 11:17:26 2022 -0400 c++: using from enclosing class template [PR105006] Here, DECL_DEPENDENT_P was false for the second using because Row<eT> is "the current instantiation", so lookup succeeds. But since Row itself has a dependent using-decl for operator(), the set of functions imported by the second using is dependent, so we should set the flag. PR c++/105006 gcc/cp/ChangeLog: * name-lookup.cc (lookup_using_decl): Set DECL_DEPENDENT_P if lookup finds a dependent using. gcc/testsuite/ChangeLog: * g++.dg/template/using30.C: New test.