[flang-commits] [flang] [Flang][#212316] Fix -Wunused-template errors under -Werror (PR #218985)

Aiden Grossman via flang-commits flang-commits at lists.llvm.org
Sat Sep 5 11:45:35 PDT 2026


https://github.com/boomanaiden154 commented:

> Nothing is instantiated today, so this is a future collision mode rather than a live bug — but [[maybe_unused]] static costs one token and avoids it, and it's what the project already does:

This costs more because if we don't do that we can just delete the entire template definition. We should be able to do that for all the templates in C++ sources.

> -Wunused-template isn't on by default, and no upstream configuration enables it:

This is also wrong. clang 23.1.0 enables this by default, although clang 23.1.1 reverts it due to false positives and the CUDA toolchain emitting static template definitions when it should not.

https://github.com/llvm/llvm-project/pull/218985


More information about the flang-commits mailing list