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

Doesn't compile anymore on FreeBSD #576

Closed
puffetto opened this issue Dec 12, 2022 · 2 comments · Fixed by #578
Closed

Doesn't compile anymore on FreeBSD #576

puffetto opened this issue Dec 12, 2022 · 2 comments · Fixed by #578

Comments

@puffetto
Copy link
Contributor

puffetto commented Dec 12, 2022

Hi there,
I am cleaning up a project using Crow, it did compile and run on FreeBSD12.2 and Crow pulled from old commit 4a6d5fe, using crow_all.h
Now I am trying to compile FreeBSD 13.1-RELEASE using current Crow from GIT and I get:

In file included from /home/blackye/prcd/programs/prcd-postal.cpp:11:
In file included from /usr/local/include/crow_all.h:105:
/usr/include/c++/v1/unordered_map:776:17: error: no viable overloaded '='
        __ref() = _VSTD::forward<_ValueTp>(__v);
        ~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/v1/__hash_table:1713:47: note: in instantiation of function template specialization 'std::__hash_value_type<std::string, crow::json::wvalue>::operator=<const std::pair<const std::string, crow::json::wvalue> &, void>' requested here
                __cache->__upcast()->__value_ = *__first;
                                              ^
/usr/include/c++/v1/unordered_map:1720:14: note: in instantiation of function template specialization 'std::__hash_table<std::__hash_value_type<std::string, crow::json::wvalue>, std::__unordered_map_hasher<std::string, std::__hash_value_type<std::string, crow::json::wvalue>, std::hash<std::string>, std::equal_to<std::string>, true>, std::__unordered_map_equal<std::string, std::__hash_value_type<std::string, crow::json::wvalue>, std::equal_to<std::string>, std::hash<std::string>, true>, std::allocator<std::__hash_value_type<std::string, crow::json::wvalue>>>::__assign_unique<const std::pair<const std::string, crow::json::wvalue> *>' requested here
    __table_.__assign_unique(__il.begin(), __il.end());
             ^
/usr/local/include/crow_all.h:8234:26: note: in instantiation of member function 'std::unordered_map<std::string, crow::json::wvalue>::operator=' requested here
                    (*o) = initializer_list;
                         ^
/usr/include/c++/v1/__utility/pair.h:257:11: note: candidate function not viable: no known conversion from 'const std::pair<const std::string, crow::json::wvalue>' to 'const typename conditional<is_copy_assignable<first_type>::value && is_copy_assignable<second_type>::value, pair<string &, wvalue &>, __nat>::type' (aka 'const std::__nat') for 1st argument
    pair& operator=(typename conditional<
          ^
/usr/include/c++/v1/__utility/pair.h:270:11: note: candidate function not viable: no known conversion from 'const std::pair<const std::string, crow::json::wvalue>' to 'typename conditional<is_move_assignable<first_type>::value && is_move_assignable<second_type>::value, pair<string &, wvalue &>, __nat>::type' (aka 'std::__nat') for 1st argument
    pair& operator=(typename conditional<
          ^
/usr/include/c++/v1/__utility/pair.h:79:62: note: candidate template ignored: disabled by 'enable_if' [with _Tuple = const std::pair<const std::string, crow::json::wvalue> &]
    using _EnableB _LIBCPP_NODEBUG_TYPE = typename enable_if<_Val, bool>::type;
                                                             ^
/usr/include/c++/v1/__utility/pair.h:42:29: note: candidate function (the implicit copy assignment operator) not viable: no known conversion from 'const pair<const std::string, crow::json::wvalue>' to 'const pair<std::string &, crow::json::wvalue &>' for 1st argument
struct _LIBCPP_TEMPLATE_VIS pair
                            ^

Using #include <crow.h> instead of crow_all doesn't change it.

Compiler is as follows:

blackye@rigatino:~/prcd/build-FreeBSD /usr/bin/cc --version
FreeBSD clang version 13.0.0 ([email protected]:llvm/llvm-project.git llvmorg-13.0.0-0-gd7b669b3a303)
Target: x86_64-unknown-freebsd13.1
Thread model: posix
InstalledDir: /usr/bin

Any hint?

@puffetto
Copy link
Contributor Author

Additional info:
the issue arises even configuring Crow with a plain cmake and trying to compile its own tests:

blackye@rigatino:~ git clone https://github.com/CrowCpp/Crow.git
Cloning into 'Crow'...
remote: Enumerating objects: 54732, done.
remote: Counting objects: 100% (3414/3414), done.
remote: Compressing objects: 100% (380/380), done.
remote: Total 54732 (delta 2970), reused 3324 (delta 2912), pack-reused 51318
Receiving objects: 100% (54732/54732), 38.07 MiB | 20.91 MiB/s, done.
Resolving deltas: 100% (48742/48742), done.
blackye@rigatino:~ cd Crow
blackye@rigatino:~/Crow mkdir build
blackye@rigatino:~/Crow cd build
blackye@rigatino:~/Crow/build cmake ..
-- The CXX compiler identification is Clang 13.0.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- No build type selected, default to Release
-- Found asio: /usr/local/include  
-- The C compiler identification is Clang 13.0.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- example_compression example deactivated
-- example_ssl example deactivated
-- Compression tests are omitted. (Configure with CROW_FEATURES containing 'compression' to enable them)
-- SSL tests are omitted. (Configure with CROW_FEATURES containing 'ssl' to enable them)
-- Configuring done
-- Generating done
-- Build files have been written to: /home/blackye/Crow/build
blackye@rigatino:~/Crow/build make
[  2%] Building CXX object examples/CMakeFiles/helloworld.dir/helloworld.cpp.o
In file included from /home/blackye/Crow/examples/helloworld.cpp:1:
In file included from /home/blackye/Crow/include/crow.h:2:
In file included from /home/blackye/Crow/include/crow/query_string.h:7:
/usr/include/c++/v1/unordered_map:776:17: error: no viable overloaded '='
        __ref() = _VSTD::forward<_ValueTp>(__v);
        ~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/v1/__hash_table:1713:47: note: in instantiation of function template specialization 'std::__hash_value_type<std::string, crow::json::wvalue>::operator=<const std::pair<const std::string, crow::json::wvalue> &, void>' requested here
                __cache->__upcast()->__value_ = *__first;
                                              ^
/usr/include/c++/v1/unordered_map:1720:14: note: in instantiation of function template specialization 'std::__hash_table<std::__hash_value_type<std::string, crow::json::wvalue>, std::__unordered_map_hasher<std::string, std::__hash_value_type<std::string, crow::json::wvalue>, std::hash<std::string>, std::equal_to<std::string>, true>, std::__unordered_map_equal<std::string, std::__hash_value_type<std::string, crow::json::wvalue>, std::equal_to<std::string>, std::hash<std::string>, true>, std::allocator<std::__hash_value_type<std::string, crow::json::wvalue>>>::__assign_unique<const std::pair<const std::string, crow::json::wvalue> *>' requested here
    __table_.__assign_unique(__il.begin(), __il.end());
             ^
/home/blackye/Crow/include/crow/json.h:1659:26: note: in instantiation of member function 'std::unordered_map<std::string, crow::json::wvalue>::operator=' requested here
                    (*o) = initializer_list;
                         ^
/usr/include/c++/v1/__utility/pair.h:257:11: note: candidate function not viable: no known conversion from 'const std::pair<const std::string, crow::json::wvalue>' to 'const typename conditional<is_copy_assignable<first_type>::value && is_copy_assignable<second_type>::value, pair<string &, wvalue &>, __nat>::type' (aka 'const std::__nat') for 1st argument
    pair& operator=(typename conditional<
          ^
/usr/include/c++/v1/__utility/pair.h:270:11: note: candidate function not viable: no known conversion from 'const std::pair<const std::string, crow::json::wvalue>' to 'typename conditional<is_move_assignable<first_type>::value && is_move_assignable<second_type>::value, pair<string &, wvalue &>, __nat>::type' (aka 'std::__nat') for 1st argument
    pair& operator=(typename conditional<
          ^
/usr/include/c++/v1/__utility/pair.h:79:62: note: candidate template ignored: disabled by 'enable_if' [with _Tuple = const std::pair<const std::string, crow::json::wvalue> &]
    using _EnableB _LIBCPP_NODEBUG_TYPE = typename enable_if<_Val, bool>::type;
                                                             ^
/usr/include/c++/v1/__utility/pair.h:42:29: note: candidate function (the implicit copy assignment operator) not viable: no known conversion from 'const pair<const std::string, crow::json::wvalue>' to 'const pair<std::string &, crow::json::wvalue &>' for 1st argument
struct _LIBCPP_TEMPLATE_VIS pair
                            ^
In file included from /home/blackye/Crow/examples/helloworld.cpp:1:
In file included from /home/blackye/Crow/include/crow.h:2:
In file included from /home/blackye/Crow/include/crow/query_string.h:7:
/usr/include/c++/v1/unordered_map:757:17: error: no viable overloaded '='
        __ref() = __v.__get_value();
        ~~~~~~~ ^ ~~~~~~~~~~~~~~~~~
/usr/include/c++/v1/__hash_table:1753:47: note: in instantiation of member function 'std::__hash_value_type<std::string, crow::json::wvalue>::operator=' requested here
                __cache->__upcast()->__value_ = *__first;
                                              ^
/usr/include/c++/v1/__hash_table:1550:9: note: in instantiation of function template specialization 'std::__hash_table<std::__hash_value_type<std::string, crow::json::wvalue>, std::__unordered_map_hasher<std::string, std::__hash_value_type<std::string, crow::json::wvalue>, std::hash<std::string>, std::equal_to<std::string>, true>, std::__unordered_map_equal<std::string, std::__hash_value_type<std::string, crow::json::wvalue>, std::equal_to<std::string>, std::hash<std::string>, true>, std::allocator<std::__hash_value_type<std::string, crow::json::wvalue>>>::__assign_multi<std::__hash_const_iterator<std::__hash_node<std::__hash_value_type<std::string, crow::json::wvalue>, void *> *>>' requested here
        __assign_multi(__u.begin(), __u.end());
        ^
/usr/include/c++/v1/unordered_map:1053:18: note: in instantiation of member function 'std::__hash_table<std::__hash_value_type<std::string, crow::json::wvalue>, std::__unordered_map_hasher<std::string, std::__hash_value_type<std::string, crow::json::wvalue>, std::hash<std::string>, std::equal_to<std::string>, true>, std::__unordered_map_equal<std::string, std::__hash_value_type<std::string, crow::json::wvalue>, std::equal_to<std::string>, std::hash<std::string>, true>, std::allocator<std::__hash_value_type<std::string, crow::json::wvalue>>>::operator=' requested here
        __table_ = __u.__table_;
                 ^
/home/blackye/Crow/include/crow/json.h:1678:26: note: in instantiation of member function 'std::unordered_map<std::string, crow::json::wvalue>::operator=' requested here
                    (*o) = value;
                         ^
/usr/include/c++/v1/__utility/pair.h:257:11: note: candidate function not viable: no known conversion from 'const std::__hash_value_type<std::string, crow::json::wvalue>::value_type' (aka 'const pair<const std::string, crow::json::wvalue>') to 'const typename conditional<is_copy_assignable<first_type>::value && is_copy_assignable<second_type>::value, pair<string &, wvalue &>, __nat>::type' (aka 'const std::__nat') for 1st argument
    pair& operator=(typename conditional<
          ^
/usr/include/c++/v1/__utility/pair.h:270:11: note: candidate function not viable: no known conversion from 'const std::__hash_value_type<std::string, crow::json::wvalue>::value_type' (aka 'const pair<const std::string, crow::json::wvalue>') to 'typename conditional<is_move_assignable<first_type>::value && is_move_assignable<second_type>::value, pair<string &, wvalue &>, __nat>::type' (aka 'std::__nat') for 1st argument
    pair& operator=(typename conditional<
          ^
/usr/include/c++/v1/__utility/pair.h:79:62: note: candidate template ignored: disabled by 'enable_if' [with _Tuple = const std::pair<const std::string, crow::json::wvalue> &]
    using _EnableB _LIBCPP_NODEBUG_TYPE = typename enable_if<_Val, bool>::type;
                                                             ^
/usr/include/c++/v1/__utility/pair.h:42:29: note: candidate function (the implicit copy assignment operator) not viable: no known conversion from 'const pair<const std::__hash_value_type<std::string, crow::json::wvalue>::key_type, std::__hash_value_type<std::string, crow::json::wvalue>::mapped_type>' to 'const pair<std::string &, crow::json::wvalue &>' for 1st argument
struct _LIBCPP_TEMPLATE_VIS pair
                            ^
2 errors generated.
*** Error code 1

Stop.
make[2]: stopped in /usr/home/blackye/Crow/build
*** Error code 1

Stop.
make[1]: stopped in /usr/home/blackye/Crow/build
*** Error code 1

Stop.
make: stopped in /usr/home/blackye/Crow/build
blackye@rigatino:~/Crow/build 

@puffetto
Copy link
Contributor Author

Compiles and seems to work with requested pull.
Cheers,
A.

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

Successfully merging a pull request may close this issue.

1 participant