[PATCH] D14619: [PATCH] clang-tidy checker for nothrow copy constructible exception objects

Alexander Kornienko via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 12 10:04:32 PST 2015


alexfh added inline comments.

================
Comment at: clang-tidy/cert/ThrownExceptionTypeCheck.cpp:36
@@ +35,3 @@
+  bool Diag = false;
+  for (const auto *Ctor : RD->ctors()) {
+    if (Ctor->isCopyConstructor()) {
----------------
I'd slightly prefer this check to be expressed as a matcher:

  cxxThrowExpr(has(cxxConstructExpr(hasDeclaration(<insert your isNothrow() matcher here>))))

Which is also a more correct thing to do and doesn't seem to be "a lot harder" ;)


http://reviews.llvm.org/D14619





More information about the cfe-commits mailing list