[PATCH] gdb/testsuite: Fix FAILs in gdb.linespec/cpcompletion.exp when using clang

Tom Tromey tom@tromey.com
Thu Jan 5 20:06:38 GMT 2023


>>>>> Bruno Larsen via Gdb-patches <gdb-patches@sourceware.org> writes:

> When using clang 16.0.0 to test gdb.linespec/cpcompletion.exp, I get 99
> unexpected failures.  They all fail to produce a complete list of
> completion options for a function, either overload2_function,
> overload3_function or anon_ns_function.  This happens because clang is
> optimizing them away, since they are never used.

> Fix this by adding __attribute__((used)) to all declarations to the
> aforementioned functions.

Thanks for the patch.  I guess we use this attribute in the tests
already, so I think this is ok.

Tom


More information about the Gdb-patches mailing list