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

Comment at: clang-tidy/misc/ThrowKeywordMissingCheck.cpp:21
+void ThrowKeywordMissingCheck::registerMatchers(MatchFinder *Finder) {
+  // This is a C++ only checker.
+  if (!getLangOpts().CPlusPlus)
Superfluous comment, this can be removed.

Comment at: clang-tidy/misc/ThrowKeywordMissingCheck.cpp:32
+           hasType(cxxRecordDecl(
+               isSameOrDerivedFrom(matchesName("[Ee]xception|EXCEPTION")))),
+           unless(anyOf(hasAncestor(stmt(
`matchesName` says

> Does not match typedefs of an underlying type with the given name.

Does your check find the following case?

typedef std::exception ERROR_BASE;
class my_error : public ERROR_BASE {
  /* Usual yadda. */

int main() {

Comment at: clang-tidy/misc/ThrowKeywordMissingCheck.cpp:46
+      Result.Nodes.getNodeAs<Expr>("temporary-exception-not-thrown");
+  diag(TemporaryExpr->getLocStart(), "exception created but is not thrown");
Either use passive for both subsentences or don't use passive at all. Maybe one 
of the following could be a better wording:

> exception instantied and not thrown

> exception is constructed but is not thrown

> exception construction without a throw statement

Comment at: test/clang-tidy/misc-throw-keyword-missing.cpp:23
+// std::exception and std::runtime_error declaration
+struct exception{
+  exception();
Please format the code. Why isn't there a space before `{`?

Comment at: test/clang-tidy/misc-throw-keyword-missing.cpp:29
+struct runtime_error : public exception{
+  explicit runtime_error( const std::string& what_arg );
Format here too.

  rCTE Clang Tools Extra


cfe-commits mailing list

Reply via email to