From 8c0a344b0dd759ebb6f1873b051a537b66ee8d3e Mon Sep 17 00:00:00 2001 From: Foster Brereton Date: Thu, 25 Oct 2018 00:00:48 -0700 Subject: [PATCH] lambda type support, for auto return types that return a lambda --- matchers/utilities.cpp | 9 --------- matchers/utilities.hpp | 4 +++- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/matchers/utilities.cpp b/matchers/utilities.cpp index f72a956..237f81c 100644 --- a/matchers/utilities.cpp +++ b/matchers/utilities.cpp @@ -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 <"; diff --git a/matchers/utilities.hpp b/matchers/utilities.hpp index 4a1d8bd..3de9d58 100644 --- a/matchers/utilities.hpp +++ b/matchers/utilities.hpp @@ -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; } /**************************************************************************************************/