[all-commits] [llvm/llvm-project] 39c424: [clang-tidy] Added virtual isLanguageVersionSuppor...

Nathan James via All-commits all-commits at lists.llvm.org
Fri Feb 28 05:05:10 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 39c4246e1e5bb76b1bca2e4b0d0ebc4005d75c32
      https://github.com/llvm/llvm-project/commit/39c4246e1e5bb76b1bca2e4b0d0ebc4005d75c32
  Author: Nathan James <n.james93 at hotmail.co.uk>
  Date:   2020-02-28 (Fri, 28 Feb 2020)

  Changed paths:
    M clang-tools-extra/clang-tidy/ClangTidy.cpp
    M clang-tools-extra/clang-tidy/ClangTidyCheck.h
    M clang-tools-extra/clang-tidy/modernize/MakeSmartPtrCheck.cpp
    M clang-tools-extra/clang-tidy/modernize/MakeSmartPtrCheck.h
    M clang-tools-extra/clangd/ParsedAST.cpp
    M clang-tools-extra/unittests/clang-tidy/ClangTidyTest.h

  Log Message:
  -----------
  [clang-tidy] Added virtual isLanguageVersionSupported to ClangTidyCheck

Summary:
Motivated by [[ https://bugs.llvm.org/show_bug.cgi?id=45045 | Tune inspections to a specific C++ standard. ]]
Moves the isLanguageVersionSupported virtual function from `MakeSmartPtrCheck` to the base `ClangTidyCheck` class.
This will disable registering matchers or pp callbacks on unsupported language versions for a check.
Having it as a standalone function is cleaner than manually disabling the check in the register function and should hopefully
encourage check developers to actually restrict the check based on language version.
As an added bonus this could enable automatic detection of what language version a check runs on for the purpose of documentation generation

Reviewers: aaron.ballman, gribozavr2, Eugene.Zelenko, JonasToth, alexfh, hokein

Reviewed By: gribozavr2

Subscribers: xazax.hun, jkorous, arphaman, kadircet, usaxena95, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D75289




More information about the All-commits mailing list