Skip to content

Commit

Permalink
lambda type support, for auto return types that return a lambda
Browse files Browse the repository at this point in the history
  • Loading branch information
fosterbrereton committed Oct 25, 2018
1 parent 675b629 commit 8c0a344
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
9 changes: 0 additions & 9 deletions matchers/utilities.cpp
Expand Up @@ -64,15 +64,6 @@ std::string to_string(const ASTContext* n, SourceRange range, bool as_token) {

/**************************************************************************************************/

std::string to_string(const ASTContext* n,
SourceLocation begin,
SourceLocation end,
bool as_token) {
return ::to_string(n, SourceRange(std::move(begin), std::move(end)), as_token);
}

/**************************************************************************************************/

std::string to_string(const ASTContext* n, const clang::TemplateDecl* template_decl) {
std::size_t count{0};
std::string result = "template <";
Expand Down
4 changes: 3 additions & 1 deletion matchers/utilities.hpp
Expand Up @@ -61,7 +61,9 @@ inline std::string to_string(clang::AccessSpecifier access) {

inline std::string to_string(const clang::ASTContext* n, clang::QualType type) {
static const clang::PrintingPolicy policy(n->getLangOpts());
return type.getAsString(policy);
std::string result = type.getAsString(policy);
bool is_lambda = result.find("(lambda at ") == 0;
return is_lambda ? "__lambda" : result;
}

/**************************************************************************************************/
Expand Down

0 comments on commit 8c0a344

Please sign in to comment.