brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.5 KiB · 12e6839 Raw
38 lines · c
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-exception6//7//===----------------------------------------------------------------------===//8 9#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_PERFORMANCE_NOEXCEPTDESTRUCTORCHECK_H10#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_PERFORMANCE_NOEXCEPTDESTRUCTORCHECK_H11 12#include "../ClangTidyCheck.h"13#include "NoexceptFunctionBaseCheck.h"14 15namespace clang::tidy::performance {16 17/// The check flags destructors not marked with `noexcept` or marked18/// with `noexcept(expr)` where `expr` evaluates to `false`19/// (but is not a `false` literal itself).20///21/// For the user-facing documentation see:22/// https://clang.llvm.org/extra/clang-tidy/checks/performance/noexcept-destructor.html23class NoexceptDestructorCheck : public NoexceptFunctionBaseCheck {24public:25  using NoexceptFunctionBaseCheck::NoexceptFunctionBaseCheck;26 27  void registerMatchers(ast_matchers::MatchFinder *Finder) override;28 29private:30  DiagnosticBuilder reportMissingNoexcept(const FunctionDecl *FuncDecl) final;31  void reportNoexceptEvaluatedToFalse(const FunctionDecl *FuncDecl,32                                      const Expr *NoexceptExpr) final;33};34 35} // namespace clang::tidy::performance36 37#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_PERFORMANCE_NOEXCEPTDESTRUCTORCHECK_H38