10 #include "clang/AST/ASTContext.h" 11 #include "clang/ASTMatchers/ASTMatchFinder.h" 12 #include "clang/ASTMatchers/ASTMatchersInternal.h" 22 return Node.getType()->castAs<FunctionProtoType>()->hasTrailingReturn();
26 void TrailingReturnCheck::registerMatchers(MatchFinder *Finder) {
29 if (!getLangOpts().CPlusPlus11)
36 functionDecl(hasTrailingReturn(),
37 unless(anyOf(returns(decltypeType()),
38 hasParent(cxxRecordDecl(isLambda())))))
43 void TrailingReturnCheck::check(
const MatchFinder::MatchResult &
Result) {
44 if (
const auto *
D = Result.Nodes.getNodeAs<Decl>(
"decl"))
45 diag(
D->getBeginLoc(),
46 "a trailing return type is disallowed for this type of declaration");
AST_MATCHER(Expr, isMacroID)
===– Representation.cpp - ClangDoc Representation --------—*- C++ -*-===//
llvm::Optional< llvm::Expected< tooling::AtomicChanges > > Result