0

Is there a good reason why Clang-Tidy complains about missing [[nodiscard]] for a constant member function without parameters? Could the compiler not work that out itself and warn if the return value gets discarded?

In my opinion this is redundant information for the human reader.

Alex Guteniev
  • 12,039
  • 2
  • 34
  • 79
Henk
  • 826
  • 3
  • 14
  • 1
    Declaration and definition might be split. So easier to have warning to add attribute which would be then easier to check. – Jarod42 Jan 20 '21 at 10:04

1 Answers1

0

I don't see any good reason, it just decreases the signal/noise ratio.

smibe
  • 159
  • 10