You are not logged in.
I'm trying to force g++ to emit the code for all the inline methods of my classes during the compilation of the unit tests. This is to obtain a sensible coverage report, since code for inline methods that are never used is not emitted and thus it does not appear in the coverage report. This can be done on a per-method basis by adding the attribute [[gnu::used]] to the function declaration, but this is annoying (must be added to every method), error prone (one could forget to add it to a newly added method) and it clutters the code. Is there a g++ flag to automatically set this attribute for all methods/functions? Thanks.
Offline