Noticed when reduced example manually. Was a bit confused by an underline under the class and not the method: // $ cat a.cc namespace { struct Foo { void m1(); void m2(); }; void Foo::m1() {} void Foo::m2() {} } int main() { Foo o; o.m1(); } $ gcc -c a.cc -Wall a.cc:7:10: warning: 'void {anonymous}::Foo::m2()' defined but not used [-Wunused-function] 7 | void Foo::m2() {} | ^~~ Here it's not visible, but m2 is correctly highlighted in 'void {anonymous}::Foo::m2()' string (good). But the underlying cursor points at the 'Foo' only. I think it should point at the whole 'Foo::m2' instead. For example: 7 | void Foo::m2() {} | ^~~~~~~ WDYT? GCC is built from r14-539-g143e6695b20d35. $ gcc -v Using built-in specs. COLLECT_GCC=/<<NIX>>/gcc-14.0.0/bin/gcc COLLECT_LTO_WRAPPER=/<<NIX>>/gcc-14.0.0/libexec/gcc/x86_64-unknown-linux-gnu/14.0.0/lto-wrapper Target: x86_64-unknown-linux-gnu Configured with: Thread model: posix Supported LTO compression algorithms: zlib gcc version 14.0.0 99999999 (experimental) (GCC)
Confirmed, it is not just anonymous namespaces nor class methods.. Another example showing it happens with namespaces static functions too: ``` namespace g { static void f();} static void g::f(){} ```