Skip to content

Commit 7f6da43

Browse files
author
Pavel Chupin
authored
Fix warning on build with clang based compiler (#3680)
.../llvm/clang/lib/Sema/SemaSYCL.cpp(4662,10): error: moving a local object in a return statement prevents copy elision [-Werror,-Wpessimizing-move] return std::move(NewShimName); ^ .../llvm/clang/lib/Sema/SemaSYCL.cpp(4662,10): note: remove std::move call here return std::move(NewShimName); ^~~~~~~~~~ ~ Signed-off-by: Pavel V Chupin <[email protected]>
1 parent 8662149 commit 7f6da43

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

clang/lib/Sema/SemaSYCL.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4624,7 +4624,7 @@ static std::string EmitSpecIdShim(raw_ostream &OS, unsigned &ShimCounter,
46244624
PrintNSClosingBraces(OS, Decl::castToDeclContext(AnonNS));
46254625

46264626
++ShimCounter;
4627-
return std::move(NewShimName);
4627+
return NewShimName;
46284628
}
46294629

46304630
// Emit the list of shims required for a DeclContext, calls itself recursively.
@@ -4670,7 +4670,7 @@ static std::string EmitSpecIdShims(raw_ostream &OS, unsigned &ShimCounter,
46704670
"Function assumes this is in an anonymous namespace");
46714671
std::string RelativeName = VD->getNameAsString();
46724672
EmitSpecIdShims(OS, ShimCounter, VD->getDeclContext(), RelativeName);
4673-
return std::move(RelativeName);
4673+
return RelativeName;
46744674
}
46754675

46764676
bool SYCLIntegrationFooter::emit(raw_ostream &OS) {

0 commit comments

Comments
 (0)