[PATCH] D55433: [clang-tidy] Adding a new modernize use nodiscard checker

MyDeveloperDay via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Dec 10 02:06:57 PST 2018


MyDeveloperDay marked an inline comment as done.
MyDeveloperDay added inline comments.


================
Comment at: docs/clang-tidy/checks/modernize-use-nodiscard.rst:62
+Users can use :option:`IgnoreInternalFunctions` to turn off the adding of
+``[nodiscard]]`` to functions starting with _ e.g. _Foo()
+
----------------
MyDeveloperDay wrote:
> curdeius wrote:
> > curdeius wrote:
> > > Missing leading `[` in `[nodiscard]]`, should be `[[nodiscard]]`
> > It might have been discussed already, but is it a common convention to mark internal functions with a leading underscore?
> > If that comes from system headers, AFAIK clang-tidy already is able not to emit warnings from them.
> If you feel this is an unnecessary option, I'm happy to remove it, it might simplify things.
on reflection as both @curdeius  and other reviews expressed concern of "isInternalFunction" motivation, I decided to remove this as an option, I think I was letting my usecase get mixed up with the design


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D55433/new/

https://reviews.llvm.org/D55433





More information about the cfe-commits mailing list