websocketpp icon indicating copy to clipboard operation
websocketpp copied to clipboard

In basic.hpp, a few compiling error with g++11, C++20,

Open yushb0602 opened this issue 3 years ago • 14 comments

I have tried the lastest version, and v0.8.2 tags, the same error message. No this message if compile with C++17.


/home/OGic-2/cppsrc/../3rdparty/websocketpp/logger/basic.hpp:61:54: error: expected ')' before 'h' 61 | basic<concurrency,names>(channel_type_hint::value h =channel_type_hint::access) | ~ ^~ | ) /home/OGic-2/cppsrc/../3rdparty/websocketpp/logger/basic.hpp:66:42: error: expected ')' before '*' token 66 | basic<concurrency,names>(std::ostream * out) | ~ ^~ | ) /home/OGic-2/cppsrc/../3rdparty/websocketpp/logger/basic.hpp:71:35: error: expected ')' before 'c' 71 | basic<concurrency,names>(level c, channel_type_hint::value h = | ~ ^~ | ) /home/OGic-2/cppsrc/../3rdparty/websocketpp/logger/basic.hpp:77:35: error: expected ')' before 'c' 77 | basic<concurrency,names>(level c, std::ostream * out) | ~ ^~ | ) /home/OGic-2/cppsrc/../3rdparty/websocketpp/logger/basic.hpp:83:5: error: template-id not allowed for destructor 83 | ~basic<concurrency,names>() {} | ^ /home/OGic-2/cppsrc/../3rdparty/websocketpp/logger/basic.hpp:86:54: error: expected ')' before 'const' 86 | basic<concurrency,names>(basic<concurrency,names> const & other) | ~ ^~~~~~ | ) /home/OGic-2/cppsrc/../3rdparty/websocketpp/logger/basic.hpp:99:54: error: expected ')' before '&&' token 99 | basic<concurrency,names>(basic<concurrency,names> && other) | ~ ^~~ | ) In file included from /home/OGic-2/cppsrc/../3rdparty/websocketpp/roles/server_endpoint.hpp:31, from /home/OGic-2/cppsrc/../3rdparty/websocketpp/server.hpp:31, from /home/OGic-2/cppsrc/ws.hpp:4, from /home/OGic-2/cppsrc/main.cpp:15: /home/OGic-2/cppsrc/../3rdparty/websocketpp/endpoint.hpp:112:5: error: template-id not allowed for destructor 112 | ~endpoint<connection,config>() {} | ^ In file included from /home/OGic-2/cppsrc/../3rdparty/websocketpp/server.hpp:31, from /home/OGic-2/cppsrc/ws.hpp:4, from /home/OGic-2/cppsrc/main.cpp:15: /home/OGic-2/cppsrc/../3rdparty/websocketpp/roles/server_endpoint.hpp:75:5: error: template-id not allowed for destructor 75 | ~server() {} | ^ /home/OGic-2/cppsrc/../3rdparty/websocketpp/roles/server_endpoint.hpp:79:34: error: expected ')' before '&' token 79 | server(server &) = delete; | ~ ^~ | ) /home/OGic-2/cppsrc/../3rdparty/websocketpp/roles/server_endpoint.hpp:87:34: error: expected ')' before '&&' token 87 | server(server && o) : endpoint<connection,config>(std::move(o)) {} | ~ ^~~ | ) In file included from /home/OGic-2/cppsrc/globals.h:11, from /home/OGic-2/cppsrc/CChannel.h:11, from /home/OGic-2/cppsrc/COGCore.h:13, from /home/OGic-2/cppsrc/main.cpp:17: /home/OGic-2/cppsrc/../3rdparty/nlohmann/json.hpp: In static member function 'static CharType nlohmann::detail::binary_writer<BasicJsonType, CharType>::to_char_type(uint8_t)': /home/OGic-2/cppsrc/../3rdparty/nlohmann/json.hpp:12595:28: warning: 'template<class _Tp> struct std::is_pod' is deprecated: use is_standard_layout && is_trivial instead [-Wdeprecated-declarations] 12595 | static_assert(std::is_pod<CharType>::value, "CharType must be POD"); | ^~~~~~ In file included from /home/OGic-2/cppsrc/../3rdparty/fmt/ranges.h:16, from /home/OGic-2/cppsrc/main.cpp:3: /usr/local/include/c++/11.1.0/type_traits:700:5: note: declared here 700 | is_pod | ^~~~~~ In file included from /home/OGic-2/cppsrc/../3rdparty/websocketpp/roles/server_endpoint.hpp:31, from /home/OGic-2/cppsrc/../3rdparty/websocketpp/server.hpp:31, from /home/OGic-2/cppsrc/ws.hpp:4, from /home/OGic-2/cppsrc/main.cpp:15: /home/OGic-2/cppsrc/../3rdparty/websocketpp/endpoint.hpp: In instantiation of 'websocketpp::endpoint<connection, config>::endpoint(bool) [with connection = websocketpp::connectionwebsocketpp::config::asio; config = websocketpp::config::asio]': /home/OGic-2/cppsrc/../3rdparty/websocketpp/roles/server_endpoint.hpp:69:43: required from 'websocketpp::server::server() [with config = websocketpp::config::asio]' /home/OGic-2/cppsrc/ws.hpp:12:22: required from here /home/OGic-2/cppsrc/../3rdparty/websocketpp/endpoint.hpp:92:16: error: no matching function for call to 'websocketpp::log::basic<websocketpp::concurrency::basic, websocketpp::log::alevel>::basic(const level&, const value&)' 92 | : m_alog(new alog_type(config::alog_level, log::channel_type_hint::access)) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /home/OGic-2/cppsrc/../3rdparty/websocketpp/config/core.hpp:51, from /home/OGic-2/cppsrc/../3rdparty/websocketpp/config/asio_no_tls.hpp:31, from /home/OGic-2/cppsrc/ws.hpp:3, from /home/OGic-2/cppsrc/main.cpp:15: /home/OGic-2/cppsrc/../3rdparty/websocketpp/logger/basic.hpp:59:7: note: candidate: 'websocketpp::log::basic<websocketpp::concurrency::basic, websocketpp::log::alevel>::basic()' (deleted) 59 | class basic { | ^~~~~ /home/OGic-2/cppsrc/../3rdparty/websocketpp/logger/basic.hpp:59:7: note: candidate expects 0 arguments, 2 provided /home/OGic-2/cppsrc/../3rdparty/websocketpp/logger/basic.hpp:59:7: note: candidate: 'websocketpp::log::basic<websocketpp::concurrency::basic, websocketpp::log::alevel>::basic(const websocketpp::log::basic<websocketpp::concurrency::basic, websocketpp::log::alevel>&)' (deleted) /home/OGic-2/cppsrc/../3rdparty/websocketpp/logger/basic.hpp:59:7: note: candidate expects 1 argument, 2 provided In file included from /home/OGic-2/cppsrc/../3rdparty/websocketpp/roles/server_endpoint.hpp:31, from /home/OGic-2/cppsrc/../3rdparty/websocketpp/server.hpp:31, from /home/OGic-2/cppsrc/ws.hpp:4, from /home/OGic-2/cppsrc/main.cpp:15: /home/OGic-2/cppsrc/../3rdparty/websocketpp/endpoint.hpp:93:16: error: no matching function for call to 'websocketpp::log::basic<websocketpp::concurrency::basic, websocketpp::log::elevel>::basic(const level&, const value&)' 93 | , m_elog(new elog_type(config::elog_level, log::channel_type_hint::error)) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /home/OGic-2/cppsrc/../3rdparty/websocketpp/config/core.hpp:51, from /home/OGic-2/cppsrc/../3rdparty/websocketpp/config/asio_no_tls.hpp:31, from /home/OGic-2/cppsrc/ws.hpp:3, from /home/OGic-2/cppsrc/main.cpp:15: /home/OGic-2/cppsrc/../3rdparty/websocketpp/logger/basic.hpp:59:7: note: candidate: 'websocketpp::log::basic<websocketpp::concurrency::basic, websocketpp::log::elevel>::basic()' (deleted) 59 | class basic { | ^~~~~ /home/OGic-2/cppsrc/../3rdparty/websocketpp/logger/basic.hpp:59:7: note: candidate expects 0 arguments, 2 provided /home/OGic-2/cppsrc/../3rdparty/websocketpp/logger/basic.hpp:59:7: note: candidate: 'websocketpp::log::basic<websocketpp::concurrency::basic, websocketpp::log::elevel>::basic(const websocketpp::log::basic<websocketpp::concurrency::basic, websocketpp::log::elevel>&)' (deleted) /home/OGic-2/cppsrc/../3rdparty/websocketpp/logger/basic.hpp:59:7: note: candidate expects 1 argument, 2 provided make[2]: *** [CMakeFiles/cpp20.dir/build.make:76: CMakeFiles/cpp20.dir/main.cpp.o] Error 1 make[1]: *** [CMakeFiles/Makefile2:232: CMakeFiles/cpp20.dir/all] Error 2

yushb0602 avatar May 17 '21 07:05 yushb0602

Same issue there with GCC 11.0.1 in C++20 mode

Arthapz avatar May 17 '21 16:05 Arthapz

the reason is the useless usage of <concurrency,names> after constructor definition (and destructor), after removing them, it build fine

Arthapz avatar May 17 '21 17:05 Arthapz

can confirm the issue (and the solution)

jcelerier avatar May 23 '21 14:05 jcelerier

note that this was valid until C++20: https://timsong-cpp.github.io/cppwp/n4861/diff.cpp17.class#2

jcelerier avatar May 23 '21 15:05 jcelerier

feel free to pull my patch https://github.com/jcelerier/websocketpp/commit/3e761b5aa2d415bbe8cf211c7c9a847e4e5f2044

jcelerier avatar May 23 '21 16:05 jcelerier

do you think it will be merged at some point? looks like the project hasn't had any commit in a long time... It is a bit annoying when you are using a package manager like Conan.

Macfly avatar Jun 02 '21 04:06 Macfly

A fix for this has been pushed to the develop branch. That branch will be rolled up into a 0.9 release soon.

zaphoyd avatar Jun 29 '21 14:06 zaphoyd

A fix for this has been pushed to the develop branch. That branch will be rolled up into a 0.9 release soon.

any update on the 0.9 release?

Macfly avatar Oct 08 '21 01:10 Macfly

Will fork to get the changes from develop in the meantime, but a new 0.9 release would be great 🙏

lapointexavier avatar Oct 29 '21 21:10 lapointexavier

Bump on the 0.9 release 🙏 Works like a charm on Windows

Ramjii avatar Dec 15 '21 19:12 Ramjii

Please bump on the 0.9 release QQ

plsmaop avatar Nov 02 '22 06:11 plsmaop

Bump for 0.9 release, please!

Elwinnaar avatar Nov 16 '23 11:11 Elwinnaar

2000 years later

Amtrix avatar Dec 03 '23 01:12 Amtrix

3000 years later

GianlucaCerilli avatar Apr 05 '24 11:04 GianlucaCerilli