Skip to content

Commit d9b220c

Browse files
authored
Merge pull request #82708 from Bigcheese/dev/importer-ub
[ClangImporter] Fix dangling reference.
2 parents 8520829 + 75ac27d commit d9b220c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/ClangImporter/ClangDerivedConformances.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,8 @@ instantiateTemplatedOperator(ClangImporter::Implementation &impl,
265265
classDecl->getLocation(), clang::OverloadCandidateSet::CSK_Operator,
266266
clang::OverloadCandidateSet::OperatorRewriteInfo(opKind,
267267
clang::SourceLocation(), false));
268-
clangSema.LookupOverloadedBinOp(candidateSet, opKind, ops, {arg, arg}, true);
268+
std::array<clang::Expr *, 2> args{arg, arg};
269+
clangSema.LookupOverloadedBinOp(candidateSet, opKind, ops, args, true);
269270

270271
clang::OverloadCandidateSet::iterator best;
271272
switch (candidateSet.BestViableFunction(clangSema, clang::SourceLocation(),

0 commit comments

Comments
 (0)