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.
lookup.value = lookup_member (binfo, lookup.name, /*protect=*/2,
/*want_type=*/false, tf_none);
+ /* If the lookup in the base contains a dependent using, this
+ using is also dependent. */
+ if (!dependent_p && lookup.value)
+ {
+ tree val = lookup.value;
+ if (tree fns = maybe_get_fns (val))
+ val = fns;
+ for (tree f: lkp_range (val))
+ if (TREE_CODE (f) == USING_DECL && DECL_DEPENDENT_P (f))
+ {
+ dependent_p = true;
+ break;
+ }
+ }
+
if (!depscope && b_kind < bk_proper_base)
{
if (cxx_dialect >= cxx20 && lookup.value
--- /dev/null
+// PR c++/105006
+
+template<class eT>
+class Row {
+ using eT::operator();
+ void operator()();
+ class fixed;
+};
+
+template<class eT>
+class Row<eT>::fixed : Row {
+ using Row::operator();
+};