clang-tools 23.0.0git
TypeSwitchCaseTypesCheck.h
Go to the documentation of this file.
1//===----------------------------------------------------------------------===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_LLVM_TYPESWITCHCASETYPESCHECK_H
10#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_LLVM_TYPESWITCHCASETYPESCHECK_H
11
12#include "../ClangTidyCheck.h"
13
15
16/// Simplifies llvm::TypeSwitch Case calls by removing redundant explicit
17/// template arguments or replacing 'auto' lambda parameters with explicit
18/// types.
19///
20/// For the user-facing documentation see:
21/// https://clang.llvm.org/extra/clang-tidy/checks/llvm/type-switch-case-types.html
23public:
24 using ClangTidyCheck::ClangTidyCheck;
25 void registerMatchers(ast_matchers::MatchFinder *Finder) override;
26 void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
27
28 bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
29 return LangOpts.CPlusPlus;
30 }
31};
32
33} // namespace clang::tidy::llvm_check
34
35#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_LLVM_TYPESWITCHCASETYPESCHECK_H
Simplifies llvm::TypeSwitch Case calls by removing redundant explicit template arguments or replacing...
bool isLanguageVersionSupported(const LangOptions &LangOpts) const override
void registerMatchers(ast_matchers::MatchFinder *Finder) override
void check(const ast_matchers::MatchFinder::MatchResult &Result) override