Skip to content

[flang-rt] Fix -Wunused-template in time intrinsics and test helpers (NFC) - #207979

Merged
vgvassilev merged 1 commit into
llvm:mainfrom
flash1729:wunused-template-flang-rt
Jul 8, 2026
Merged

vgvassilev merged 1 commit into
llvm:mainfrom
flash1729:wunused-template-flang-rt

Conversation

@flash1729

Copy link
Copy Markdown
Member

time-intrinsic.cpp implements the timing intrinsics as SFINAE overload sets (preferred/fallback per platform), so on any given platform some overloads are intentionally never instantiated and trip -Wunused-template. Mark all variants [[maybe_unused]].

StoreElement and MakeArray in unittests/Runtime/tools.h are static function templates in a header, so any test TU that includes it without using all of them trips the warning.

Part of #202945

…(NFC)

time-intrinsic.cpp implements the timing intrinsics as SFINAE overload sets
(preferred/fallback per platform), so on any given platform some overloads
are intentionally never instantiated and trip -Wunused-template. Mark all
variants [[maybe_unused]].

StoreElement and MakeArray in unittests/Runtime/tools.h are static function
templates in a header, so any test TU that includes it without using all of
them trips the warning. Drop static.

Part of llvm#202945.
@flash1729

Copy link
Copy Markdown
Member Author

cc @clementval @khaki3 @vgvassilev @erichkeane
I also verified that enabled -Wunused-template will not fail flang-rt builds. Please check #207942

@vgvassilev
vgvassilev merged commit 29f8993 into llvm:main Jul 8, 2026
11 checks passed
vgvassilev pushed a commit that referenced this pull request Jul 8, 2026
Reland of #206123, which was reverted in #207848.

What has changed since:

- flang-rt occurrences are fixed in #207979 
- openmp had one more occurrence which is fixed in #207983 
- The remaining -Wunused-template hits anywhere in CI logs are the tsan
Go runtime warnings, which are warnings only (buildgo.sh does not use
-Werror on Linux)

Marked as draft until #207979  and #207983  land.

Closes #202945
gandhi56 pushed a commit that referenced this pull request Jul 9, 2026
…(NFC) (#207979)

`time-intrinsic.cpp` implements the timing intrinsics as SFINAE overload
sets (preferred/fallback per platform), so on any given platform some
overloads are intentionally never instantiated and trip
-Wunused-template. Mark all variants [[maybe_unused]].

`StoreElement` and `MakeArray` in `unittests/Runtime/tools.h` are static
function templates in a header, so any test TU that includes it without
using all of them trips the warning.

Part of #202945
gandhi56 pushed a commit that referenced this pull request Jul 9, 2026
Reland of #206123, which was reverted in #207848.

What has changed since:

- flang-rt occurrences are fixed in #207979 
- openmp had one more occurrence which is fixed in #207983 
- The remaining -Wunused-template hits anywhere in CI logs are the tsan
Go runtime warnings, which are warnings only (buildgo.sh does not use
-Werror on Linux)

Marked as draft until #207979  and #207983  land.

Closes #202945
@flash1729
flash1729 deleted the wunused-template-flang-rt branch August 7, 2026 08:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants