153145213SGabor Horvath //===--- UnaryStaticAssertCheck.h - clang-tidy-------------------*- C++ -*-===// 253145213SGabor Horvath // 32946cd70SChandler Carruth // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 42946cd70SChandler Carruth // See https://llvm.org/LICENSE.txt for license information. 52946cd70SChandler Carruth // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 653145213SGabor Horvath // 753145213SGabor Horvath //===----------------------------------------------------------------------===// 853145213SGabor Horvath 953145213SGabor Horvath #ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_UNARY_STATIC_ASSERT_H 1053145213SGabor Horvath #define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_UNARY_STATIC_ASSERT_H 1153145213SGabor Horvath 12478fc5c8SAlexander Kornienko #include "../ClangTidyCheck.h" 1353145213SGabor Horvath 14*4718da50SCarlos Galvez namespace clang::tidy::modernize { 1553145213SGabor Horvath 1653145213SGabor Horvath /// Replaces a static_assert declaration with an empty message 1753145213SGabor Horvath /// with the unary version. 1853145213SGabor Horvath /// 1953145213SGabor Horvath /// For the user-facing documentation see: 206e566bc5SRichard /// http://clang.llvm.org/extra/clang-tidy/checks/modernize/unary-static-assert.html 2153145213SGabor Horvath class UnaryStaticAssertCheck : public ClangTidyCheck { 2253145213SGabor Horvath public: UnaryStaticAssertCheck(StringRef Name,ClangTidyContext * Context)2353145213SGabor Horvath UnaryStaticAssertCheck(StringRef Name, ClangTidyContext *Context) 2453145213SGabor Horvath : ClangTidyCheck(Name, Context) {} isLanguageVersionSupported(const LangOptions & LangOpts)25e40a742aSNathan James bool isLanguageVersionSupported(const LangOptions &LangOpts) const override { 26e40a742aSNathan James return LangOpts.CPlusPlus17; 27e40a742aSNathan James } 2853145213SGabor Horvath void registerMatchers(ast_matchers::MatchFinder *Finder) override; 2953145213SGabor Horvath void check(const ast_matchers::MatchFinder::MatchResult &Result) override; 3053145213SGabor Horvath }; 3153145213SGabor Horvath 32*4718da50SCarlos Galvez } // namespace clang::tidy::modernize 3353145213SGabor Horvath 3453145213SGabor Horvath #endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_UNARY_STATIC_ASSERT_H 35