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

Eugene Zelenko via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Dec 7 10:55:00 PST 2018


Eugene.Zelenko added inline comments.


================
Comment at: clang-tidy/modernize/UseNodiscardCheck.cpp:21
+namespace modernize {
+namespace {
+
----------------
Please use static instead anonymous namespace for functions. See LLVM code style guidelines.


================
Comment at: clang-tidy/modernize/UseNodiscardCheck.cpp:103
+
+  auto retLoc = MatchedDecl->getInnerLocStart();
+
----------------
Please don't use auto when type could not be deducted from same statement.


================
Comment at: docs/ReleaseNotes.rst:76
 
+- New :doc:`modernize-use-nodiscard
+  <clang-tidy/checks/modernize-use-nodiscard>` check.
----------------
Please use alphabetical order for new checks list.


================
Comment at: docs/clang-tidy/checks/modernize-use-nodiscard.rst:6
+
+This check adds ``[[nodiscard]]`` attributes (introduced in C++17) to member functions to highlight at compile time where the return value of a function should not be ignored
+
----------------
Please use 80 characters limit.


Repository:
  rCTE Clang Tools Extra

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

https://reviews.llvm.org/D55433





More information about the cfe-commits mailing list