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

Alexander Kornienko via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 17 04:56:00 PST 2017


alexfh requested changes to this revision.
alexfh added inline comments.
This revision now requires changes to proceed.


================
Comment at: clang-tidy/misc/ThrowWithNoexceptCheck.cpp:44
+    } else {
+      /* If a single one is not valid, we cannot apply the fix as we need to
+       * remove noexcept in all declarations for the fix to be effective. */
----------------
Use line comments (`//`).


================
Comment at: clang-tidy/misc/ThrowWithNoexceptCheck.cpp:53
+    // FIXME use DiagnosticIDs::Level::Note
+    diag(NoExceptRange.getBegin(), "In function declared no-throw here:")
+        << FixItHint::CreateRemoval(NoExceptRange);
----------------
nit: no leading capitalization in diagnostic messages needed.


================
Comment at: test/clang-tidy/misc-throw-with-noexcept.cpp:88
+// CHECK-MESSAGES: :[[@LINE-3]]:3: warning: 'throw' expression in a function declared with a non-throwing exception specification [misc-throw-with-noexcept]
+// CHECK-FIXES: void with_macro() {
----------------
Please add test cases where the function in question is a template itself (and another one where it's a member of a template class) and has a few instantiations.


https://reviews.llvm.org/D19201





More information about the cfe-commits mailing list