Skip to content

Commit c99da40

Browse files
author
Erich Keane
authored
[SYCL] Fix a -Wrange-loop-construct warning in #4296 (#4316)
This warns for creating a copy of the pair (which I figured was cheap enough to copy, but *shrug*), so this fails us on the Werror build. Pass by reference instead.
1 parent f387c5a commit c99da40

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

clang/lib/Sema/SemaSYCL.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3870,7 +3870,7 @@ void Sema::SetSYCLKernelNames() {
38703870
getASTContext().createMangleContext());
38713871
// We assume the list of KernelDescs is the complete list of kernels needing
38723872
// to be rewritten.
3873-
for (const std::pair<const FunctionDecl *, FunctionDecl *> Pair :
3873+
for (const std::pair<const FunctionDecl *, FunctionDecl *> &Pair :
38743874
SyclKernelsToOpenCLKernels) {
38753875
std::string CalculatedName, StableName;
38763876
std::tie(CalculatedName, StableName) =

0 commit comments

Comments
 (0)