// Wrapper for an overload set.
template <typename ToDeclT> struct CallOverloadedCreateFun {
- template <typename... Args>
- auto operator()(Args &&... args)
- -> decltype(ToDeclT::Create(std::forward<Args>(args)...)) {
+ template <typename... Args> decltype(auto) operator()(Args &&... args) {
return ToDeclT::Create(std::forward<Args>(args)...);
}
};
BugReporter &BR) const;
};
-auto callsName(const char *FunctionName)
- -> decltype(callee(functionDecl())) {
+decltype(auto) callsName(const char *FunctionName) {
return callee(functionDecl(hasName(FunctionName)));
}
-auto equalsBoundArgDecl(int ArgIdx, const char *DeclName)
- -> decltype(hasArgument(0, expr())) {
+decltype(auto) equalsBoundArgDecl(int ArgIdx, const char *DeclName) {
return hasArgument(ArgIdx, ignoringParenCasts(declRefExpr(
to(varDecl(equalsBoundNode(DeclName))))));
}
-auto bindAssignmentToDecl(const char *DeclName) -> decltype(hasLHS(expr())) {
+decltype(auto) bindAssignmentToDecl(const char *DeclName) {
return hasLHS(ignoringParenImpCasts(
declRefExpr(to(varDecl().bind(DeclName)))));
}
CE->getSourceRange());
}
-static auto hasTypePointingTo(DeclarationMatcher DeclM)
- -> decltype(hasType(pointerType())) {
+static decltype(auto) hasTypePointingTo(DeclarationMatcher DeclM) {
return hasType(pointerType(pointee(hasDeclaration(DeclM))));
}
return std::vector<llvm::StringRef>(V.begin(), V.end());
}
-static auto callsNames(std::vector<std::string> FunctionNames)
- -> decltype(callee(functionDecl())) {
+static decltype(auto) callsNames(std::vector<std::string> FunctionNames) {
return callee(functionDecl(hasAnyName(toRefs(FunctionNames))));
}
OS.str(), Location, Range);
}
-auto callsName(const char *FunctionName) -> decltype(callee(functionDecl())) {
+decltype(auto) callsName(const char *FunctionName) {
return callee(functionDecl(hasName(FunctionName)));
}