Skip to content

Commit 71bdc1f

Browse files
author
Erich Keane
authored
[SYCL] Fix invalid use of std::move in SemaTemplateInstantiateDecl.cpp (#6868)
This being used in a loop with more than one multiversion function would likely cause that mangle-context to be invalid. Also, the unqualified move is discouraged. This patch just changes the code slightly to have the lambda capture the entire unique_ptr by reference.
1 parent 01e60f7 commit 71bdc1f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

clang/lib/Sema/SemaTemplateInstantiateDecl.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6845,8 +6845,8 @@ void Sema::PerformPendingInstantiations(bool LocalOnly) {
68456845
TSK_ExplicitInstantiationDefinition;
68466846
if (Function->isMultiVersion())
68476847
getASTContext().forEachMultiversionedFunctionVersion(
6848-
Function, [this, Inst, DefinitionRequired,
6849-
MangleCtx = move(MangleCtx)](FunctionDecl *CurFD) {
6848+
Function,
6849+
[this, Inst, DefinitionRequired, &MangleCtx](FunctionDecl *CurFD) {
68506850
processFunctionInstantiation(*this, Inst.second, CurFD,
68516851
DefinitionRequired, *MangleCtx);
68526852
});

0 commit comments

Comments
 (0)