[[nodiscard]] for constant getter functions

372 views Asked by At

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.

1

There are 1 answers

0
smibe On

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