Added rendering of concept requirements in concept body

This commit is contained in:
Bartek Kryza
2023-02-26 23:29:55 +01:00
parent 2ab6ed627e
commit dbb3e68c3f
12 changed files with 232 additions and 69 deletions

View File

@@ -228,6 +228,21 @@ std::string to_string(const clang::FunctionTemplateDecl *decl)
fmt::join(template_parameters, ","), "");
}
std::string to_string(const clang::TypeConstraint *tc)
{
if (tc == nullptr)
return {};
const clang::PrintingPolicy print_policy(
tc->getNamedConcept()->getASTContext().getLangOpts());
std::string ostream_buf;
llvm::raw_string_ostream ostream{ostream_buf};
tc->print(ostream, print_policy);
return ostream.str();
}
std::string get_source_text_raw(
clang::SourceRange range, const clang::SourceManager &sm)
{