Repository navigation
Closed
Labels
Description
Fedora Rawhide recently switched to clang 23 which causes vmr builds to fail due to unused function templates warnings (with warn-as-error):
In file included from /home/tester/workdir/dotnet/src/runtime/src/coreclr/jit/block.cpp:18:
/home/tester/workdir/dotnet/src/runtime/src/coreclr/jit/jitstd/algorithm.h:17:6: error: unused function template 'insertion_sort' [-Werror,-Wunused-template]
17 | void insertion_sort(RandomAccessIterator first, RandomAccessIterator last, Less less)
| ^~~~~~~~~~~~~~
/home/tester/workdir/dotnet/src/runtime/src/coreclr/jit/jitstd/algorithm.h:35:6: error: unused function template 'quick_sort' [-Werror,-Wunused-template]
35 | void quick_sort(RandomAccessIterator first, RandomAccessIterator last, Less less)
| ^~~~~~~~~~
2 errors generated.
It may be possible to handle the warnings by removing the header and add some special handling (for example fgdiagnostic.cpp uses it only under DEBUG).
Ignoring the warnings also works:
diff --git a/src/runtime/eng/native/configurecompiler.cmake b/src/runtime/eng/native/configurecompiler.cmake
index bc5fcb1733ac..b4952040aa4a 100644
--- a/src/runtime/eng/native/configurecompiler.cmake
+++ b/src/runtime/eng/native/configurecompiler.cmake
@@ -724,6 +724,9 @@ if (CLR_CMAKE_HOST_UNIX OR CLR_CMAKE_HOST_WASI)
# clang 20 suppressions
add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-Wno-nontrivial-memaccess>)
+
+ # clang 23 suppressions
+ add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-Wno-unused-template>)
else()
add_compile_options(-Wno-uninitialized)
add_compile_options(-Wno-strict-aliasing)I'm seeing these errors when building the .NET 11 release branch from VMR. We should probably set PRERELEASE to 0 for .NET 11 to prevent the warnings from becoming errors (and cause the build to fail):
| set(PRERELEASE 1) |
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
jkotas commentedon Sep 17, 2026
#134125
dotnet-policy-service commentedon Sep 17, 2026
Tagging subscribers to this area: @dotnet/runtime-infrastructure
See info in area-owners.md if you want to be subscribed.
jkotas commentedon Sep 17, 2026
I see clang reverted this as too disruptive and with false positives llvm/llvm-project#218429 and linked PRs/issues.
If it is still a problem, free to submit PR against main. This warning does not seem to have net positive value. I think it is best to disable it.
tmds commentedon Sep 17, 2026
#134125 addressed it for .NET 11.
I can wait a few months to see if the revert makes its way into clang 23/Rawhide. If it doesn't by .NET 12 preview releases, I'll make a PR to suppress it.
Thanks @jkotas!
[release/11.0] Set PRERELEASE to 0 (#134125)