ericniebler / range-v3

Range library for C++14/17/20, basis for C++20's std::ranges
Other
4.06k stars 437 forks source link

Tests fail due to -Werror with clang 13.0.0 #1685

Open klemensn opened 2 years ago

klemensn commented 2 years ago

On OpenBSD 7.0 -CURRENT, clang 13.0.0 is used as the default compiler (not on all architectures, though):

$ cc --version
OpenBSD clang version 13.0.0
Target: amd64-unknown-openbsd7.0
Thread model: posix
InstalledDir: /usr/bin

Compiling the test suite with clang fails due to the following warnings being treated as errors (-Werror):

# error: identifier '...' is reserved because it contains '__' [-Werror,-Wreserved-identifier]
# error: '~...' overrides a destructor but is not marked 'override' [-Werror,-Wsuggest-destructor-override]
# error: '...' overrides a member function but is not marked 'override' [-Werror,-Wsuggest-override]

This effects the 0.11.0 release as well as latest master of today (9aa032ccd0eb4bd77f58e5b181168f1038c222c6). Using GCC 8.4.0 does not show these, i.e. tests compile fine without tweaks.

To fix the clang build in the official range-v3 package, I currently pass -DRANGES_HAS_WERROR=0 to treat warnings as non-fatal in general. To silence the warning spam (hundreds of lines of the same three types), I also currently build with the following added to OpenBSD's default CXXFLAGS:

-Wno-reserved-identifier
-Wno-suggest-destructor-override
-Wno-suggest-override

This way, all tests pass on OpenBSD/clang.

FWIW, here are the full logs for make configure in the official range-v3 package, showing cmake's detection results and more: https://gist.github.com/a5b004709d00c93d8d551b2b87d905a6 Here are the full logs for make test without above mentioned fix, i.e. the full amount of warnings/errors: https://gist.github.com/5685833cb45cf0f109633f75af790b89