xref: /llvm-project/clang-tools-extra/clang-tidy/fuchsia/TrailingReturnCheck.h (revision 4718da506091a37ca4863d979bc541e359b79b10)
193a88e33SJulie Hockett //===--- TrailingReturnCheck.h - clang-tidy----------------------*- C++ -*-===//
293a88e33SJulie Hockett //
32946cd70SChandler Carruth // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
42946cd70SChandler Carruth // See https://llvm.org/LICENSE.txt for license information.
52946cd70SChandler Carruth // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
693a88e33SJulie Hockett //
793a88e33SJulie Hockett //===----------------------------------------------------------------------===//
893a88e33SJulie Hockett 
993a88e33SJulie Hockett #ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_FUCHSIA_TRAILING_RETURN_H
1093a88e33SJulie Hockett #define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_FUCHSIA_TRAILING_RETURN_H
1193a88e33SJulie Hockett 
12478fc5c8SAlexander Kornienko #include "../ClangTidyCheck.h"
1393a88e33SJulie Hockett 
14*4718da50SCarlos Galvez namespace clang::tidy::fuchsia {
1593a88e33SJulie Hockett 
1693a88e33SJulie Hockett /// Functions that have trailing returns are disallowed, except for those
1793a88e33SJulie Hockett /// using decltype specifiers and lambda with otherwise unutterable
1893a88e33SJulie Hockett /// return types.
1993a88e33SJulie Hockett ///
2093a88e33SJulie Hockett /// For the user-facing documentation see:
216e566bc5SRichard /// http://clang.llvm.org/extra/clang-tidy/checks/fuchsia/trailing-return.html
2293a88e33SJulie Hockett class TrailingReturnCheck : public ClangTidyCheck {
2393a88e33SJulie Hockett public:
TrailingReturnCheck(StringRef Name,ClangTidyContext * Context)2493a88e33SJulie Hockett   TrailingReturnCheck(StringRef Name, ClangTidyContext *Context)
2593a88e33SJulie Hockett       : ClangTidyCheck(Name, Context) {}
isLanguageVersionSupported(const LangOptions & LangOpts)26e40a742aSNathan James   bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
27e40a742aSNathan James     return LangOpts.CPlusPlus11;
28e40a742aSNathan James   }
2993a88e33SJulie Hockett   void registerMatchers(ast_matchers::MatchFinder *Finder) override;
3093a88e33SJulie Hockett   void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
3193a88e33SJulie Hockett };
3293a88e33SJulie Hockett 
33*4718da50SCarlos Galvez } // namespace clang::tidy::fuchsia
3493a88e33SJulie Hockett 
3593a88e33SJulie Hockett #endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_FUCHSIA_TRAILING_RETURN_H
36