[PATCH] D148458: [clang-tidy][NFC] Split bugprone-exception-escape tests

Carlos Galvez via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Apr 23 02:54:19 PDT 2023


carlosgalvezp added inline comments.


================
Comment at: clang-tools-extra/test/clang-tidy/checkers/bugprone/exception-escape-throw.cpp:4
+void throwing_throw_nothing() throw() {
+// CHECK-MESSAGES: :[[@LINE-1]]:6: warning: an exception may be thrown in function 'throwing_throw_nothing' which should not throw exceptions
+  throw 1;
----------------
Please align comments


================
Comment at: clang-tools-extra/test/clang-tidy/checkers/bugprone/exception-escape-throw.cpp:11
+void implicit_int_thrower() {
+    throw 5;
+}
----------------
Please use 2 chars indentation. This can be configured in the IDE.


================
Comment at: clang-tools-extra/test/clang-tidy/checkers/bugprone/exception-escape.cpp:267
     const derived *p = &d;
-    throw p; 
   } catch(base *) {
----------------
PiotrZSL wrote:
> carlosgalvezp wrote:
> > I run into this often as well. If you don't want to get push back during review because of this I advice you to disable the automatic trailing whitespace removal for this project. Regular source code will be fixed via clang-format anyway. Alternatively you will be asked to fix it in (another) NFC patch :) 
> > 
> > I personally don't mind a couple or two such fixes, but here there's a lot of them and really create noise, distracting from the actual patch.
> Excuses...
Excuses for what?


================
Comment at: clang-tools-extra/test/clang-tidy/checkers/bugprone/exception-escape.cpp:555-557
+void explicit_int_thrower() noexcept(false) {
+  throw 1;
+}
----------------
PiotrZSL wrote:
> carlosgalvezp wrote:
> > Why this change?
> this test file tests only noexcept, not throw.
> i added throw 1 just so check would still see as an throw of integer type.
Ack.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D148458



More information about the cfe-commits mailing list