[libcxx-commits] [libcxx] [libc++][test] Fix unused and nodiscard warnings (PR #73437)

Stephan T. Lavavej via libcxx-commits libcxx-commits at lists.llvm.org
Sun Nov 26 06:13:20 PST 2023


StephanTLavavej wrote:

`params.py` has already opted into `-Wunused-variable` and `-Wunused-parameter`, but explicitly opted out with `-Wno-unused-local-typedef`:

https://github.com/llvm/llvm-project/blob/9ba74c2ee044381544c8e1e736c4c85a1a9d56bf/libcxx/utils/libcxx/test/params.py#L52-L55

I'm seeing these warnings because of our exotic configuration of using MSVC's STL, so `LIBCPP_ASSERT` etc. expand to nothing. (And we don't go through `libcxx/utils/libcxx/test/params.py`, so we get unused-local-typedef warnings despite the opt-out mentioned there.)

To prevent backsliding between microsoft/STL's infrequent updates of its llvm-project submodule, I suppose you could add a test configuration where `LIBCPP_ASSERT` etc. are forced to expand to nothing despite being used with libc++ product code - but that seems like it would be a lot of effort to find relatively low value issues that are easily fixed.

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


More information about the libcxx-commits mailing list