Skip to content

Commit 8c0a344

Browse files
lambda type support, for auto return types that return a lambda
1 parent 675b629 commit 8c0a344

File tree

2 files changed

+3
-10
lines changed

2 files changed

+3
-10
lines changed

matchers/utilities.cpp

-9
Original file line numberDiff line numberDiff line change
@@ -64,15 +64,6 @@ std::string to_string(const ASTContext* n, SourceRange range, bool as_token) {
6464

6565
/**************************************************************************************************/
6666

67-
std::string to_string(const ASTContext* n,
68-
SourceLocation begin,
69-
SourceLocation end,
70-
bool as_token) {
71-
return ::to_string(n, SourceRange(std::move(begin), std::move(end)), as_token);
72-
}
73-
74-
/**************************************************************************************************/
75-
7667
std::string to_string(const ASTContext* n, const clang::TemplateDecl* template_decl) {
7768
std::size_t count{0};
7869
std::string result = "template <";

matchers/utilities.hpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,9 @@ inline std::string to_string(clang::AccessSpecifier access) {
6161

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

6769
/**************************************************************************************************/

0 commit comments

Comments
 (0)