aaron.ballman added inline comments.

================
Comment at: clang-tidy/modernize/UseNoexceptCheck.cpp:16
@@ +15,3 @@
+
+// FIXME: Should this be moved to ASTMatchers.h?
+namespace ast_matchers {
----------------
alexfh wrote:
> Yes, it might make sense to move it to ASTMatchers.h.
Yes, please (along with tests and documentation, etc).

================
Comment at: clang-tidy/modernize/UseNoexceptCheck.cpp:94
@@ +93,3 @@
+
+  const FunctionDecl *FuncDecl =
+      Result.Nodes.getNodeAs<clang::FunctionDecl>("functionDecl");
----------------
Can use `auto` here to not repeat the type name from the initializer.

================
Comment at: clang-tidy/modernize/UseNoexceptCheck.cpp:148
@@ +147,3 @@
+    CurrentLoc = Tok.getLocation();
+  }
+
----------------
I think all of this custom logic can be replaced by looking at the 
FunctionType. If it has a dynamic exception specification 
(`hasDynamicExceptionSpec()`) then whether it is throwing or not throwing 
(`isNothrow()`) determines whether you replace with `noexcept(false)`  or 
`noexcept`. But then you don't have to go back to the source to see what is 
written.


http://reviews.llvm.org/D18575



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to