Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-10 08:36:21

0001 //===--- TemplateVirtualMemberFunctionCheck.h - clang-tidy ------*- C++ -*-===//
0002 //
0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0004 // See https://llvm.org/LICENSE.txt for license information.
0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0006 //
0007 //===----------------------------------------------------------------------===//
0008 
0009 #ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_PORTABILITY_TEMPLATEVIRTUALMEMBERFUNCTIONCHECK_H
0010 #define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_PORTABILITY_TEMPLATEVIRTUALMEMBERFUNCTIONCHECK_H
0011 
0012 #include "../ClangTidyCheck.h"
0013 
0014 namespace clang::tidy::portability {
0015 
0016 /// Upon instantiating a template class, non-virtual member functions don't have
0017 /// to be instantiated unless they are used. Virtual member function
0018 /// instantiation on the other hand is unspecified and depends on the
0019 /// implementation of the compiler. This check intends to find cases when a
0020 /// virtual member function is not instantiated but it might be with a different
0021 /// compiler.
0022 ///
0023 /// For the user-facing documentation see:
0024 /// http://clang.llvm.org/extra/clang-tidy/checks/portability/template-virtual-member-function.html
0025 class TemplateVirtualMemberFunctionCheck : public ClangTidyCheck {
0026 public:
0027   TemplateVirtualMemberFunctionCheck(StringRef Name, ClangTidyContext *Context)
0028       : ClangTidyCheck(Name, Context) {}
0029   void registerMatchers(ast_matchers::MatchFinder *Finder) override;
0030   void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
0031   bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
0032     return LangOpts.CPlusPlus;
0033   }
0034 };
0035 
0036 } // namespace clang::tidy::portability
0037 
0038 #endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_PORTABILITY_TEMPLATEVIRTUALMEMBERFUNCTIONCHECK_H