From 0330fba6e16db9b5d2079313646f93485c5ccf39 Mon Sep 17 00:00:00 2001 From: Saar Raz Date: Tue, 15 Oct 2019 18:44:06 +0000 Subject: [Concept] Associated Constraints Infrastructure Add code to correctly calculate the associated constraints of a template (no enforcement yet). D41284 on Phabricator. llvm-svn: 374938 --- clang/lib/Serialization/ASTWriter.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'clang/lib/Serialization/ASTWriter.cpp') diff --git a/clang/lib/Serialization/ASTWriter.cpp b/clang/lib/Serialization/ASTWriter.cpp index 5e9e650fce8..aef35231163 100644 --- a/clang/lib/Serialization/ASTWriter.cpp +++ b/clang/lib/Serialization/ASTWriter.cpp @@ -6070,10 +6070,16 @@ void ASTRecordWriter::AddTemplateParameterList( AddSourceLocation(TemplateParams->getTemplateLoc()); AddSourceLocation(TemplateParams->getLAngleLoc()); AddSourceLocation(TemplateParams->getRAngleLoc()); - // TODO: Concepts + Record->push_back(TemplateParams->size()); for (const auto &P : *TemplateParams) AddDeclRef(P); + if (const Expr *RequiresClause = TemplateParams->getRequiresClause()) { + Record->push_back(true); + AddStmt(const_cast(RequiresClause)); + } else { + Record->push_back(false); + } } /// Emit a template argument list. -- cgit v1.2.3