Skip to content

Commit 8fcd74e

Browse files
committed
AST: GenericParamList::clone() doesn't need to preserve source locations
1 parent a1ae109 commit 8fcd74e

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

lib/AST/Decl.cpp

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -928,18 +928,14 @@ GenericParamList::clone(DeclContext *dc) const {
928928
SmallVector<GenericTypeParamDecl *, 2> params;
929929
for (auto param : getParams()) {
930930
auto *newParam = new (ctx) GenericTypeParamDecl(
931-
dc, param->getName(), param->getNameLoc(),
931+
dc, param->getName(), SourceLoc(),
932932
GenericTypeParamDecl::InvalidDepth,
933933
param->getIndex());
934+
newParam->setImplicit(true);
934935
params.push_back(newParam);
935936
}
936937

937-
return GenericParamList::create(ctx,
938-
getLAngleLoc(),
939-
params,
940-
getWhereLoc(),
941-
/*requirements=*/{},
942-
getRAngleLoc());
938+
return GenericParamList::create(ctx, SourceLoc(), params, SourceLoc());
943939
}
944940

945941
void GenericParamList::addTrailingWhereClause(

0 commit comments

Comments
 (0)