Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion lib/ClangImporter/ClangDerivedConformances.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,8 @@ instantiateTemplatedOperator(ClangImporter::Implementation &impl,
classDecl->getLocation(), clang::OverloadCandidateSet::CSK_Operator,
clang::OverloadCandidateSet::OperatorRewriteInfo(opKind,
clang::SourceLocation(), false));
clangSema.LookupOverloadedBinOp(candidateSet, opKind, ops, {arg, arg}, true);
std::array<clang::Expr *, 2> args{arg, arg};
clangSema.LookupOverloadedBinOp(candidateSet, opKind, ops, args, true);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you elaborate on where this array gets stored and for how long? Are we storing the array in the candidateSet?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it's stored in candidateSet so the lifetime needs to extend to the last use of candidateSet, excluding the destructor.


clang::OverloadCandidateSet::iterator best;
switch (candidateSet.BestViableFunction(clangSema, clang::SourceLocation(),
Expand Down