davidstone / bounded-integer

C++ library aiming to replace all built-in integers
Boost Software License 1.0
88 stars 3 forks source link

compile-time errors with clang #3

Closed worthless443 closed 1 year ago

worthless443 commented 1 year ago

I've set CMAKE_CXX_COMPILER to clang in the top-level CMakeLists.txt. When building results in some errors (each type of error is only reported once). [1]

bounded-integer/include/bounded/detail/minmax.hpp:30:34: error: overloaded 'operator()' cannot be a static member function
        static constexpr decltype(auto) operator()(Compare const compare, LHS && lhs, RHS && rhs) {

[2]

bounded-integer/include/bounded/detail/minmax.hpp:107:9: error: no matching function for call to object of type 'const struct extreme_function'
        return extreme(std::less(), OPERATORS_FORWARD(ts)...);

I'm not sure if I'm supposed to enable any clang extensions or not, or if that's because of it I'm seeing the errors.

davidstone commented 1 year ago

This is caused by compiling with an older version of clang. I'm working on getting GitHub actions working so that I can test against the latest released version and trunk and start tagging the final commit that supports each compiler version. I've tried to update the documentation to reflect version requirements, but sometimes I accidentally commit something that works only with trunk clang. That's especially true now that I use modules and clang 16 has some implementation bugs.

worthless443 commented 1 year ago

@davidstone I think it would be helpful to raise errors in time of configuring when Clang version is lower than what you support or if specific extensions are not present.