/* Remember we found nothing! */
return error_mark_node;
- tree d = is_overloaded_fn (fns) ? get_first_fn (fns) : fns;
+ tree d = fns;
+ if (TREE_CODE (d) == TREE_LIST)
+ d = TREE_VALUE (d);
+ if (is_overloaded_fn (d))
+ d = get_first_fn (d);
if (DECL_CLASS_SCOPE_P (d))
/* We don't need to remember class-scope functions or declarations,
normal unqualified lookup will find them again. */
- fns = NULL_TREE;
+ return NULL_TREE;
return fns;
}
if (tree val = TREE_VALUE (binds))
{
tree name = TREE_PURPOSE (binds);
- push_local_binding (name, val, /*using*/true);
+ if (TREE_CODE (val) == TREE_LIST)
+ for (tree v = val; v; v = TREE_CHAIN (v))
+ push_local_binding (name, TREE_VALUE (v), /*using*/true);
+ else
+ push_local_binding (name, val, /*using*/true);
}
}
--- /dev/null
+// PR c++/97582
+// { dg-do compile { target c++11 } }
+
+struct C1 { void operator+(); };
+struct C2 { void operator+(); };
+struct C3 : C1, C2 {
+ template <class T> void get() { [] (T x) { +x; }; } // { dg-error "ambiguous" }
+};
+
+template void C3::get<C1>(); // { dg-bogus "" }
+template void C3::get<C2>(); // { dg-bogus "" }
+template void C3::get<C3>(); // { dg-message "required from here" }