[PATCH] D14824: [PATCH] Add clang-tidy check for static or thread_local objects where construction may throw

Alexander Kornienko via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 25 06:56:38 PST 2015


alexfh added a comment.

Sorry for the delay, I was sick last week.

Looks mostly fine.


================
Comment at: clang-tidy/cert/CERTTidyModule.cpp:19
@@ -18,2 +18,3 @@
 #include "../misc/ThrowByValueCatchByReferenceCheck.h"
+#include "StaticObjectExceptionCheck.h"
 #include "SetLongJmpCheck.h"
----------------
Please sort includes.

================
Comment at: clang-tidy/cert/StaticObjectExceptionCheck.cpp:18
@@ +17,3 @@
+namespace {
+AST_MATCHER(CXXConstructorDecl, isNoThrowConstructor) {
+  const auto *FnTy = Node.getType()->getAs<FunctionProtoType>();
----------------
ThrownExceptionTypeCheck.cpp defines a similar matcher. Looks like we need to move the `isNothrow` part to the ASTMatchers.h already.

================
Comment at: clang-tidy/cert/StaticObjectExceptionCheck.h:18
@@ +17,3 @@
+
+/// FIXME: Write a short description.
+///
----------------
Maybe address the FIXME right away? ;)


http://reviews.llvm.org/D14824





More information about the cfe-commits mailing list