[PATCH] D19201: [clang-tidy] misc-throw-with-noexcept

Piotr Padlewski via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat May 6 03:04:21 PDT 2017


Prazek added inline comments.


================
Comment at: clang-tidy/misc/ThrowWithNoexceptCheck.cpp:22
+void ThrowWithNoexceptCheck::registerMatchers(MatchFinder *Finder) {
+  if (!getLangOpts().CPlusPlus11)
+    return;
----------------
If we handle throw() then it should be CPlusPlus


================
Comment at: clang-tidy/misc/ThrowWithNoexceptCheck.cpp:28
+      )
+          .bind("throw"),
+      this);
----------------
is this cland-formatted?


================
Comment at: clang-tidy/misc/ThrowWithNoexceptCheck.cpp:51-53
+    if (CaughtAsRecordType == ThrownAsRecordType) {
+      return true;
+    }
----------------
Here and in many other places - remove unnecessary braces (llvm coding style)


================
Comment at: clang-tidy/misc/ThrowWithNoexceptCheck.cpp:117
+
+  if (isCatchedInFunction(Result.Context, Throw, Function, ast_type_traits::DynTypedNode::create(*Throw))) {
+    return;
----------------
clang-format whole file


================
Comment at: docs/clang-tidy/checks/misc-throw-with-noexcept.rst:9-10
+
+Please note that the warning is issued even if the exception is caught within
+the same function, as that would be probably a bad style anyway.
+
----------------
This is probably outdated. Also mention the other features that you developed here.


https://reviews.llvm.org/D19201





More information about the cfe-commits mailing list