eteran/cpp-utilities

Compilation failed on MSYS2 CLANG64

Opened this issue · 0 comments

$ clang -v
clang version 18.1.1
Target: x86_64-w64-windows-gnu
Thread model: posix
InstalledDir: C:/msys64/clang64/bin
-- Found Boost: C:/msys64/clang64/lib/cmake/Boost-1.84.0/BoostConfig.cmake (found version "1.84.0")
-- Configuring done (0.0s)
-- Generating done (0.0s)
-- Build files have been written to: C:/msys64/home/Administrator/cpp-utilities/build
$ ninja
[1/28] Building CXX object algorithm/test/CMakeFiles/cpp-utilities-algorithm-test.dir/algorithm.cpp.obj
[2/28] Linking CXX executable algorithm\test\cpp-utilities-algorithm-test.exe
[3/28] Building CXX object fixed/test/CMakeFiles/cpp-utilities-fixed-test.dir/fixed.cpp.obj
FAILED: fixed/test/CMakeFiles/cpp-utilities-fixed-test.dir/fixed.cpp.obj
C:\msys64\clang64\bin\c++.exe  -IC:/msys64/home/Administrator/cpp-utilities/fixed/include -Werror -MD -MT fixed/test/CMakeFiles/cpp-utilities-fixed-test.dir/fixed.cpp.obj -MF fixed\test\CMakeFiles\cpp-utilities-fixed-test.dir\fixed.cpp.obj.d -o fixed/test/CMakeFiles/cpp-utilities-fixed-test.dir/fixed.cpp.obj -c C:/msys64/home/Administrator/cpp-utilities/fixed/test/fixed.cpp
In file included from C:/msys64/home/Administrator/cpp-utilities/fixed/test/fixed.cpp:1:
C:/msys64/home/Administrator/cpp-utilities/fixed/include/cpp-utilities/fixed.h:292:36: error: overflow in expression; result is -2147483648 with type 'int' [-Werror,-Winteger-overflow]
  292 |                 : data_(static_cast<base_type>(n * one)) {
      |                                                ~~^~~~~
1 error generated.
[4/28] Building CXX object container/test/flat_map/CMakeFiles/cpp-utilities-container-test-flat_map.dir/flat_map.cpp.obj
FAILED: container/test/flat_map/CMakeFiles/cpp-utilities-container-test-flat_map.dir/flat_map.cpp.obj
C:\msys64\clang64\bin\c++.exe  -IC:/msys64/home/Administrator/cpp-utilities/container/include -Werror -MD -MT container/test/flat_map/CMakeFiles/cpp-utilities-container-test-flat_map.dir/flat_map.cpp.obj -MF container\test\flat_map\CMakeFiles\cpp-utilities-container-test-flat_map.dir\flat_map.cpp.obj.d -o container/test/flat_map/CMakeFiles/cpp-utilities-container-test-flat_map.dir/flat_map.cpp.obj -c C:/msys64/home/Administrator/cpp-utilities/container/test/flat_map/flat_map.cpp
In file included from C:/msys64/home/Administrator/cpp-utilities/container/test/flat_map/flat_map.cpp:1:
In file included from C:/msys64/home/Administrator/cpp-utilities/container/include/cpp-utilities/flat_map.h:6:
In file included from C:/msys64/clang64/include/c++/v1/functional:526:
In file included from C:/msys64/clang64/include/c++/v1/__functional/boyer_moore_searcher.h:27:
C:/msys64/clang64/include/c++/v1/vector:408:18: error: static assertion failed due to requirement 'is_same<std::pair<const int, std::string>, std::pair<int, std::string>>::value': Allocator::value_type must be same type as value_type
  408 |   static_assert((is_same<typename allocator_type::value_type, value_type>::value),
      |                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:/msys64/home/Administrator/cpp-utilities/container/include/cpp-utilities/flat_map.h:22:42: note: in instantiation of template class 'std::vector<std::pair<int, std::string>, std::allocator<std::pair<const int, std::string>>>' requested here
   22 |         using size_type              = typename storage_type::size_type;
      |                                                 ^
C:/msys64/home/Administrator/cpp-utilities/container/test/flat_map/flat_map.cpp:5:16: note: in instantiation of template class 'flat_map<int, std::string>' requested here
    5 | template class flat_map<int, std::string>;
      |                ^
In file included from C:/msys64/home/Administrator/cpp-utilities/container/test/flat_map/flat_map.cpp:1:
C:/msys64/home/Administrator/cpp-utilities/container/include/cpp-utilities/flat_map.h:132:3: error: no matching conversion for functional-style cast from 'std::initializer_list<value_type>' (aka 'initializer_list<pair<const int, std::string>>') to 'flat_map<int, std::string>'
  132 |                 flat_map(ilist).swap(*this);
      |                 ^~~~~~~~~~~~~~~
C:/msys64/home/Administrator/cpp-utilities/container/test/flat_map/flat_map.cpp:5:16: note: in instantiation of member function 'flat_map<int, std::string>::operator=' requested here
    5 | template class flat_map<int, std::string>;
      |                ^
C:/msys64/home/Administrator/cpp-utilities/container/include/cpp-utilities/flat_map.h:88:2: note: candidate constructor not viable: no known conversion from 'std::initializer_list<value_type>' (aka 'initializer_list<pair<const int, std::string>>') to 'const flat_map<int, std::string>' for 1st argument
   88 |         flat_map(const flat_map &other)
      |         ^        ~~~~~~~~~~~~~~~~~~~~~
C:/msys64/home/Administrator/cpp-utilities/container/include/cpp-utilities/flat_map.h:96:2: note: candidate constructor not viable: no known conversion from 'std::initializer_list<value_type>' (aka 'initializer_list<pair<const int, std::string>>') to 'const flat_map<int, std::string>' for 1st argument
   96 |         flat_map(const flat_map &&other)
      |         ^        ~~~~~~~~~~~~~~~~~~~~~~
C:/msys64/home/Administrator/cpp-utilities/container/include/cpp-utilities/flat_map.h:68:2: note: candidate constructor not viable: requires 0 arguments, but 1 was provided
   68 |         flat_map()
      |         ^
C:/msys64/home/Administrator/cpp-utilities/container/include/cpp-utilities/flat_map.h:92:2: note: candidate constructor not viable: requires 2 arguments, but 1 was provided
   92 |         flat_map(const flat_map &other, const Allocator &alloc)
      |         ^        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:/msys64/home/Administrator/cpp-utilities/container/include/cpp-utilities/flat_map.h:100:2: note: candidate constructor not viable: requires 2 arguments, but 1 was provided
  100 |         flat_map(const flat_map &&other, const Allocator &alloc)
      |         ^        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:/msys64/home/Administrator/cpp-utilities/container/include/cpp-utilities/flat_map.h:83:2: note: candidate constructor template not viable: requires 3 arguments, but 1 was provided
   83 |         flat_map(In first, In last, const Allocator &alloc)
      |         ^        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:/msys64/home/Administrator/cpp-utilities/container/include/cpp-utilities/flat_map.h:77:2: note: candidate constructor template not viable: requires at least 2 arguments, but 1 was provided
   77 |         flat_map(In first, In last, const Compare &comp = Compare(), const Allocator &alloc = Allocator())
      |         ^        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:/msys64/home/Administrator/cpp-utilities/container/include/cpp-utilities/flat_map.h:448:10: error: no viable conversion from '__wrap_iter<pair<const int, string> *>' to 'const key_type' (aka 'const int')
  448 |                         erase(first++);
      |                               ^~~~~~~
C:/msys64/home/Administrator/cpp-utilities/container/test/flat_map/flat_map.cpp:5:16: note: in instantiation of member function 'flat_map<int, std::string>::erase' requested here
    5 | template class flat_map<int, std::string>;
      |                ^
C:/msys64/home/Administrator/cpp-utilities/container/include/cpp-utilities/flat_map.h:442:34: note: passing argument to parameter 'key' here
  442 |         size_type erase(const key_type &key) {
      |                                         ^
C:/msys64/home/Administrator/cpp-utilities/container/include/cpp-utilities/flat_map.h:341:17: error: cannot increment value of type 'std::pair<int, const char *>'
  341 |                         insert(*first++);
      |                                 ~~~~~^
C:/msys64/home/Administrator/cpp-utilities/container/include/cpp-utilities/flat_map.h:79:3: note: in instantiation of function template specialization 'flat_map<int, std::string>::insert<std::pair<int, const char *>>' requested here
   79 |                 insert(first, last);
      |                 ^
C:/msys64/home/Administrator/cpp-utilities/container/test/flat_map/flat_map.cpp:8:35: note: in instantiation of function template specialization 'flat_map<int, std::string>::flat_map<std::pair<int, const char *>>' requested here
    8 |         flat_map<int, std::string> map = {
      |                                          ^
4 errors generated.
[5/28] Building CXX object arena/test/CMakeFiles/cpp-utilities-arena-test.dir/arena.cpp.obj
[6/28] Building CXX object container/test/flat_set/CMakeFiles/cpp-utilities-container-test-flat_set.dir/flat_set.cpp.obj
[7/28] Building CXX object container/test/lru_cache/CMakeFiles/cpp-utilities-container-test-lru_cache.dir/lru_cache.cpp.obj
[8/28] Building CXX object hash/test/CMakeFiles/cpp-utilities-hash-test.dir/test.cpp.obj
ninja: build stopped: subcommand failed.