[PATCH] D24878: ASTImporter: expressions, pt.2
Kareem Khazem via cfe-commits
cfe-commits at lists.llvm.org
Fri Sep 23 13:08:28 PDT 2016
khazem added a comment.
This diff is a continuation of https://reviews.llvm.org/D14326, which was accepted for inclusion but has not been merged in for the past couple of months.
I added a small patch so that it rebases cleanly onto master:
--- a/lib/AST/ASTImporter.cpp
+++ b/lib/AST/ASTImporter.cpp
@@ -2309,16 +2309,9 @@ bool ASTNodeImporter::ImportDefinition(EnumDecl *From, EnumDecl *To,
TemplateParameterList *ASTNodeImporter::ImportTemplateParameterList(
TemplateParameterList *Params) {
- SmallVector<NamedDecl *, 4> ToParams;
- ToParams.reserve(Params->size());
- for (TemplateParameterList::iterator P = Params->begin(),
- PEnd = Params->end();
- P != PEnd; ++P) {
- Decl *To = Importer.Import(*P);
- if (!To)
- return nullptr;
- ToParams.push_back(cast<NamedDecl>(To));
- }
+ SmallVector<NamedDecl *, 4> ToParams(Params->size());
+ if (ImportContainerChecked(*Params, ToParams))
+ return nullptr;
Expr *ToRequiresClause;
if (Expr *const R = Params->getRequiresClause()) {
One of the tests is currently failing with this patch. Specifically, there is a segfault at line 130 of test/ASTMerge/Inputs/exprs3.cpp. I'm working on getting this fixed now.
https://reviews.llvm.org/D24878
More information about the cfe-commits
mailing list