[PATCH] D44346: [clang-tidy] Add Fuchsia checker for temporary objects
Eugene Zelenko via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Mar 9 21:10:48 PST 2018
Eugene.Zelenko added inline comments.
================
Comment at: clang-tidy/fuchsia/ZxTemporaryObjectsCheck.cpp:24
+ std::string QualifiedName = Node.getQualifiedNameAsString();
+ return llvm::any_of(Names,
+ [&](StringRef Name) { return QualifiedName == Name; });
----------------
Please include STLExtras.h and string.
================
Comment at: clang-tidy/fuchsia/ZxTemporaryObjectsCheck.h:31
+ Names(utils::options::parseStringList(
+ Options.get("Names", "::std::vector"))) {}
+ void storeOptions(ClangTidyOptions::OptionMap &Opts) override;
----------------
This contradict documentation which claims that default is empty.
================
Comment at: docs/ReleaseNotes.rst:79
+ Warns on construction of specific temporary objects in the Zircon kernel.
+ Takes the list of such discouraged temporary objects as a parameter.
+
----------------
I think you could omit second statement.
================
Comment at: docs/clang-tidy/checks/fuchsia-zx-temporary-objects.rst:38
+
+ A semi-colon-separated list of fully-qualified names of C++ classes that should not be constructed as temporaries. Default is empty.
----------------
Please use 2 spaces indentation and 80 characters limit. Continuation should be indented too.
https://reviews.llvm.org/D44346
More information about the cfe-commits
mailing list