Index: clang-tidy/cppcoreguidelines/ProTypeConstCastCheck.h =================================================================== --- clang-tidy/cppcoreguidelines/ProTypeConstCastCheck.h +++ clang-tidy/cppcoreguidelines/ProTypeConstCastCheck.h @@ -31,4 +31,3 @@ } // namespace clang #endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CPPCOREGUIDELINES_PRO_TYPE_CONST_CAST_H - Index: clang-tidy/cppcoreguidelines/ProTypeConstCastCheck.cpp =================================================================== --- clang-tidy/cppcoreguidelines/ProTypeConstCastCheck.cpp +++ clang-tidy/cppcoreguidelines/ProTypeConstCastCheck.cpp @@ -17,7 +17,7 @@ namespace tidy { void ProTypeConstCastCheck::registerMatchers(MatchFinder *Finder) { - if(!getLangOpts().CPlusPlus) + if (!getLangOpts().CPlusPlus) return; Finder->addMatcher(cxxConstCastExpr().bind("cast"), this); @@ -30,4 +30,3 @@ } // namespace tidy } // namespace clang - Index: clang-tidy/cppcoreguidelines/ProTypeReinterpretCastCheck.h =================================================================== --- clang-tidy/cppcoreguidelines/ProTypeReinterpretCastCheck.h +++ clang-tidy/cppcoreguidelines/ProTypeReinterpretCastCheck.h @@ -18,7 +18,7 @@ /// Flags all occurrences of reinterpret_cast /// /// For the user-facing documentation see: -/// http://clang.llvm.org/extra/clang-tidy/checks/misc-no-reinterpret-cast.html +/// http://clang.llvm.org/extra/clang-tidy/checks/cppcoreguidelines-pro-type-reinterpret-cast.html class ProTypeReinterpretCastCheck : public ClangTidyCheck { public: ProTypeReinterpretCastCheck(StringRef Name, ClangTidyContext *Context) Index: clang-tidy/cppcoreguidelines/ProTypeReinterpretCastCheck.cpp =================================================================== --- clang-tidy/cppcoreguidelines/ProTypeReinterpretCastCheck.cpp +++ clang-tidy/cppcoreguidelines/ProTypeReinterpretCastCheck.cpp @@ -1,4 +1,4 @@ -//===--- ProTypeReinterpretCastCheck.cpp - clang-tidy--------------------------===// +//===--- ProTypeReinterpretCastCheck.cpp - clang-tidy----------------------===// // // The LLVM Compiler Infrastructure // @@ -23,11 +23,11 @@ Finder->addMatcher(cxxReinterpretCastExpr().bind("cast"), this); } -void ProTypeReinterpretCastCheck::check(const MatchFinder::MatchResult &Result) { +void ProTypeReinterpretCastCheck::check( + const MatchFinder::MatchResult &Result) { const auto *MatchedCast = Result.Nodes.getNodeAs("cast"); - diag(MatchedCast->getOperatorLoc(), - "do not use reinterpret_cast"); + diag(MatchedCast->getOperatorLoc(), "do not use reinterpret_cast"); } } // namespace tidy Index: test/clang-tidy/cppcoreguidelines-pro-type-const-cast.cpp =================================================================== --- test/clang-tidy/cppcoreguidelines-pro-type-const-cast.cpp +++ test/clang-tidy/cppcoreguidelines-pro-type-const-cast.cpp @@ -1,6 +1,6 @@ // RUN: %python %S/check_clang_tidy.py %s cppcoreguidelines-pro-type-const-cast %t -const int* i; -int* j; -void f() { j = const_cast(i); } +const int *i; +int *j; +void f() { j = const_cast(i); } // CHECK-MESSAGES: :[[@LINE-1]]:16: warning: do not use const_cast [cppcoreguidelines-pro-type-const-cast] Index: test/clang-tidy/cppcoreguidelines-pro-type-reinterpret-cast.cpp =================================================================== --- test/clang-tidy/cppcoreguidelines-pro-type-reinterpret-cast.cpp +++ test/clang-tidy/cppcoreguidelines-pro-type-reinterpret-cast.cpp @@ -1,6 +1,6 @@ // RUN: %python %S/check_clang_tidy.py %s cppcoreguidelines-pro-type-reinterpret-cast %t int i = 0; -void* j; -void f() { j = reinterpret_cast(i); } +void *j; +void f() { j = reinterpret_cast(i); } // CHECK-MESSAGES: :[[@LINE-1]]:16: warning: do not use reinterpret_cast [cppcoreguidelines-pro-type-reinterpret-cast]