https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105571

--- Comment #2 from Johel Ernesto Guerrero Peña <johelegp at gmail dot com> ---
Simplified reproducer from Bug 105743:

See https://godbolt.org/z/xq16xac15.

```C++
void f(auto x) { x(0); }
void g() {
  static constexpr auto h = [](...) { };
  f([](auto x) { h(x); });
}
```

```
<source>: In function 'void g()':
<source>:3:25: warning: variable 'h' set but not used
[-Wunused-but-set-variable]
    3 |   static constexpr auto h = [](...) { };
      |                         ^
```

Arguably, `h(x)` could perform ADL on `x`. But perhaps it'd be better to stay
silent, like the other compilers.

Reply via email to