If we are going to use get_first_fn let's make sure we operate on
is_overloaded_fn, as the rest of the codebase does, and if lookup finds
any class-scope declaration, return early too.
PR c++/93597 - ICE with lambda in operator function.
* name-lookup.c (maybe_save_operator_binding): Check is_overloaded_fn.
* g++.dg/cpp0x/lambda/lambda-93597.C: New test.
+2020-02-06 Marek Polacek <polacek@redhat.com>
+
+ PR c++/93597 - ICE with lambda in operator function.
+ * name-lookup.c (maybe_save_operator_binding): Check is_overloaded_fn.
+
2020-02-05 Jason Merrill <jason@redhat.com>
PR c++/93140
if (!fns && (fns = op_unqualified_lookup (fnname)))
{
- tree fn = get_first_fn (fns);
- if (DECL_CLASS_SCOPE_P (fn))
- /* We don't need to remember class-scope functions, normal unqualified
- lookup will find them again. */
+ tree d = is_overloaded_fn (fns) ? get_first_fn (fns) : fns;
+ if (DECL_P (d) && DECL_CLASS_SCOPE_P (d))
+ /* We don't need to remember class-scope functions or declarations,
+ normal unqualified lookup will find them again. */
return;
bindings = tree_cons (fnname, fns, bindings);
+2020-02-06 Marek Polacek <polacek@redhat.com>
+
+ PR c++/93597 - ICE with lambda in operator function.
+ * g++.dg/cpp0x/lambda/lambda-93597.C: New test.
+
2020-02-06 Tobias Burnus <tobias@codesourcery.com>
* gcc.target/arm/multilib.exp (multilib_config): Pass flags to
--- /dev/null
+// PR c++/93597 - ICE with lambda in operator function.
+// { dg-do compile { target c++11 } }
+
+template <typename T>
+struct S {
+ using T ::operator<;
+ void operator==(T x) { [x] { 0 < x; }; }
+};