[clang-tools-extra] 0361798 - [clang-tidy] Fix buildbot failing with explicit specialization in class scope

Nathan James via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 7 13:30:39 PDT 2020


Author: Nathan James
Date: 2020-04-07T21:30:29+01:00
New Revision: 0361798dbeb6ead0a79ab7985f02da347fce988e

URL: https://github.com/llvm/llvm-project/commit/0361798dbeb6ead0a79ab7985f02da347fce988e
DIFF: https://github.com/llvm/llvm-project/commit/0361798dbeb6ead0a79ab7985f02da347fce988e.diff

LOG: [clang-tidy] Fix buildbot failing with explicit specialization in class scope

Added: 
    

Modified: 
    clang-tools-extra/clang-tidy/ClangTidyCheck.h

Removed: 
    


################################################################################
diff  --git a/clang-tools-extra/clang-tidy/ClangTidyCheck.h b/clang-tools-extra/clang-tidy/ClangTidyCheck.h
index e90e92f6e136..84438c21a30b 100644
--- a/clang-tools-extra/clang-tidy/ClangTidyCheck.h
+++ b/clang-tools-extra/clang-tidy/ClangTidyCheck.h
@@ -312,41 +312,6 @@ class ClangTidyCheck : public ast_matchers::MatchFinder::MatchCallback {
       return Default;
     }
 
-    /// Read a named option from the ``Context`` and parse it as a bool.
-    ///
-    /// Reads the option with the check-local name \p LocalName from the
-    /// ``CheckOptions``. If the corresponding key is not present, returns
-    /// a ``MissingOptionError``. If the corresponding key can't be parsed as
-    /// a bool, return an ``UnparseableIntegerOptionError``.
-    template <> llvm::Expected<bool> get<bool>(StringRef LocalName) const;
-
-    /// Read a named option from the ``Context`` and parse it as a bool.
-    ///
-    /// Reads the option with the check-local name \p LocalName from the
-    /// ``CheckOptions``. If the corresponding key is not present or it can't be
-    /// parsed as a bool, returns \p Default.
-    template <> bool get<bool>(StringRef LocalName, bool Default) const;
-
-    /// Read a named option from the ``Context`` and parse it as a bool.
-    ///
-    /// Reads the option with the check-local name \p LocalName from local or
-    /// global ``CheckOptions``. Gets local option first. If local is not
-    /// present, falls back to get global option. If global option is not
-    /// present either, returns a ``MissingOptionError``. If the corresponding
-    /// key can't be parsed as a bool, return an
-    /// ``UnparseableIntegerOptionError``.
-    template <>
-    llvm::Expected<bool> getLocalOrGlobal<bool>(StringRef LocalName) const;
-
-    /// Read a named option from the ``Context`` and parse it as a bool.
-    ///
-    /// Reads the option with the check-local name \p LocalName from local or
-    /// global ``CheckOptions``. Gets local option first. If local is not
-    /// present, falls back to get global option. If global option is not
-    /// present either or it can't be parsed as a bool, returns \p Default.
-    template <>
-    bool getLocalOrGlobal<bool>(StringRef LocalName, bool Default) const;
-
     /// Read a named option from the ``Context`` and parse it as an
     /// enum type ``T`` using the \p Mapping provided. If \p IgnoreCase is set,
     /// it will search the mapping ignoring the case.
@@ -488,6 +453,47 @@ class ClangTidyCheck : public ast_matchers::MatchFinder::MatchCallback {
   const LangOptions &getLangOpts() const { return Context->getLangOpts(); }
 };
 
+/// Read a named option from the ``Context`` and parse it as a bool.
+///
+/// Reads the option with the check-local name \p LocalName from the
+/// ``CheckOptions``. If the corresponding key is not present, returns
+/// a ``MissingOptionError``. If the corresponding key can't be parsed as
+/// a bool, return an ``UnparseableIntegerOptionError``.
+template <>
+llvm::Expected<bool>
+ClangTidyCheck::OptionsView::get<bool>(StringRef LocalName) const;
+
+/// Read a named option from the ``Context`` and parse it as a bool.
+///
+/// Reads the option with the check-local name \p LocalName from the
+/// ``CheckOptions``. If the corresponding key is not present or it can't be
+/// parsed as a bool, returns \p Default.
+template <>
+bool ClangTidyCheck::OptionsView::get<bool>(StringRef LocalName,
+                                            bool Default) const;
+
+/// Read a named option from the ``Context`` and parse it as a bool.
+///
+/// Reads the option with the check-local name \p LocalName from local or
+/// global ``CheckOptions``. Gets local option first. If local is not
+/// present, falls back to get global option. If global option is not
+/// present either, returns a ``MissingOptionError``. If the corresponding
+/// key can't be parsed as a bool, return an
+/// ``UnparseableIntegerOptionError``.
+template <>
+llvm::Expected<bool>
+ClangTidyCheck::OptionsView::getLocalOrGlobal<bool>(StringRef LocalName) const;
+
+/// Read a named option from the ``Context`` and parse it as a bool.
+///
+/// Reads the option with the check-local name \p LocalName from local or
+/// global ``CheckOptions``. Gets local option first. If local is not
+/// present, falls back to get global option. If global option is not
+/// present either or it can't be parsed as a bool, returns \p Default.
+template <>
+bool ClangTidyCheck::OptionsView::getLocalOrGlobal<bool>(StringRef LocalName,
+                                                         bool Default) const;
+
 } // namespace tidy
 } // namespace clang
 


        


More information about the cfe-commits mailing list