Skip to content

Problem with compiling current master branch with gcc 9.3 #592

@RikeVoltz

Description

@RikeVoltz

C++ compiler version: gcc 9.3
Hazelcast Cpp client version: master branch
Hazelcast server version: N/A
Number of the clients: N/A
Cluster size, i.e. the number of Hazelcast cluster members: N/A
OS version (Windows/Linux/OSX): Linux Ubuntu 20.04

Expected behaviour

Hazelcast-cpp-client successfully compiles with gcc 9.3

Actual behaviour

/home/rikevoltz/work/junk/hazelcast-cpp-client/hazelcast/src/hazelcast/client/network.cpp: In constructor ‘hazelcast::client::connection::Connection::Connection(const hazelcast::client::Address&, hazelcast::client::spi::ClientContext&, int, const std::shared_ptr<hazelcast::client::connection::AuthenticationFuture>&, hazelcast::client::internal::socket::SocketFactory&, bool, hazelcast::client::connection::ClientConnectionManagerImpl&, std::chrono::_V2::steady_clock::duration&, boost::asio::ip::tcp::resolver&)’:
/home/rikevoltz/work/junk/hazelcast-cpp-client/hazelcast/src/hazelcast/client/network.cpp:911:77: error: use of deleted function ‘constexpr std::atomic<_Tp>::atomic() [with _Tp = std::chrono::time_point<std::chrono::_V2::steady_clock, std::chrono::duration<long int, std::ratio<1, 1000000000> > >]’
  911 |                       connectionManager(clientConnectionManager), alive(true) {
      |                                                                             ^
In file included from /home/rikevoltz/work/junk/hazelcast-cpp-client/hazelcast/include/hazelcast/util/AtomicBoolean.h:24,
                 from /home/rikevoltz/work/junk/hazelcast-cpp-client/hazelcast/include/hazelcast/client/connection/DefaultClientConnectionStrategy.h:21,
                 from /home/rikevoltz/work/junk/hazelcast-cpp-client/hazelcast/src/hazelcast/client/network.cpp:35:
/usr/include/c++/9/atomic:198:7: note: ‘constexpr std::atomic<_Tp>::atomic() noexcept [with _Tp = std::chrono::time_point<std::chrono::_V2::steady_clock, std::chrono::duration<long int, std::ratio<1, 1000000000> > >]’ is implicitly deleted because its exception-specification does not match the implicit exception-specification ‘’
  198 |       atomic() noexcept = default;
      |       ^~~~~~

Steps to reproduce the behaviour

cmake . && make with gcc 9.3 as compiler

Additional info

Problem occured there - there is std::atomic<std::chrono::steady_clock::time_point> closedTime variable in Connection class, that doesn't initialized explicitly in the constructor of this class. It implies using default empty constructor that entails compile error (because atomic default empty constructor is noexcept and it obligates internal variable to have noexcept default empty constructor too) in gcc<10 (in 10.0 everything is ok) and clang<9.0 (in 9 everything is ok) (probably in new versions of compilers they made time_point constructor noexcept).
Solution, proposed there may take place to fix compilation via gcc compilers, but for clang it doesn't help.
But I can miss something in my small research.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions