Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can not be compiled with clang-15 and libc++ #16

Open
kraj opened this issue Sep 3, 2022 · 1 comment
Open

Can not be compiled with clang-15 and libc++ #16

kraj opened this issue Sep 3, 2022 · 1 comment

Comments

@kraj
Copy link

kraj commented Sep 3, 2022

I am playing with clang-15 in Yocto and ended up with build errors in this compoent as below

/mnt/b/yoe/master/build/tmp/work/core2-64-yoe-linux-musl/nlohmann-fifo/1.0.0+gitAUTOINC+d732aaf9a3-r0/recipe-sysroot/usr/include/c++/v1/__random/uniform_int_distribution.h:235:5: error: static assertion failed due to requirement '__libcpp_random_is_valid_urng<Catch::RandomNumberGenerator, void>::value':
    static_assert(__libcpp_random_is_valid_urng<_URNG>::value, "");
    ^             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/mnt/b/yoe/master/build/tmp/work/core2-64-yoe-linux-musl/nlohmann-fifo/1.0.0+gitAUTOINC+d732aaf9a3-r0/recipe-sysroot/usr/include/c++/v1/__algorithm/shuffle.h:154:35: note: in instantiation of function template specialization 'std::uniform_int_distribution<long>::operator()<Catch::RandomNumberGenerator>' requested here
            difference_type __i = __uid(__g, _Pp(0, __d));
                                  ^
/mnt/b/yoe/master/build/tmp/work/core2-64-yoe-linux-musl/nlohmann-fifo/1.0.0+gitAUTOINC+d732aaf9a3-r0/recipe-sysroot/usr/include/c++/v1/__algorithm/shuffle.h:166:14: note: in instantiation of function template specialization 'std::__shuffle<std::_ClassicAlgPolicy, std::__wrap_iter<Catch::TestCase *>, std::__wrap_iter<Catch::TestCase *>, Catch::RandomNumberGenerator &>' requested here
  (void)std::__shuffle<_ClassicAlgPolicy>(
             ^
test/thirdparty/catch/catch.hpp:6539:18: note: in instantiation of function template specialization 'std::shuffle<std::__wrap_iter<Catch::TestCase *>, Catch::RandomNumberGenerator &>' requested here
            std::shuffle( vector.begin(), vector.end(), rng );
                 ^
test/thirdparty/catch/catch.hpp:6557:44: note: in instantiation of function template specialization 'Catch::RandomNumberGenerator::shuffle<std::vector<Catch::TestCase>>' requested here
                    RandomNumberGenerator::shuffle( sorted );
                                           ^
1 warning and 1 error generated.

libc++ has started to drop stuff and move towards c++17 defaults. Perhaps time to start using the std::shuffle

@jeffreypedigo
Copy link

Same error that kraj reported earlier, is there a fix for this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants