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

[BUG] island.hpp:226:16: error: cannot initialize return object of type 'void *' #584

Open
jschueller opened this issue Sep 25, 2024 · 0 comments
Labels

Comments

@jschueller
Copy link
Contributor

Describe the bug

compiling the island test with clang >= 17 on linux fails with:

In file included from /tmp/pagmo2/tests/island.cpp:56:
/tmp/pagmo2/include/pagmo/island.hpp:226:16: error: cannot initialize return object of type 'void *' with an rvalue of type 'const pagmo::thread_island *'
  226 |         return &m_value;
      |                ^~~~~~~~
/tmp/pagmo2/include/pagmo/island.hpp:1057:20: note: in instantiation of member function 'pagmo::detail::isl_inner<const pagmo::thread_island>::get_ptr' requested here
 1057 |         auto isl = dynamic_cast<detail::isl_inner<T> *>(m_ptr->isl_ptr.get());
      |                    ^
/tmp/pagmo2/tests/island.cpp:536:21: note: in instantiation of function template specialization 'pagmo::island::extract<const pagmo::thread_island>' requested here
  536 |     BOOST_CHECK(isl.extract<const thread_island>() == nullptr);
      |

To Reproduce

just build master on latest ubuntu:

FROM ubuntu:noble
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get -y update && apt-get -y install cmake clang libtbb-dev libeigen3-dev git libboost-serialization-dev libboost-test-dev g++
WORKDIR /tmp
RUN git clone --depth 1 https://github.com/esa/pagmo2.git
RUN cmake -DCMAKE_CXX_COMPILER=/usr/bin/clang++ -DCMAKE_UNITY_BUILD=ON -DPAGMO_WITH_EIGEN3=ON -DPAGMO_BUILD_TESTS=ON -S pagmo2 -B build 
RUN cmake --build build --parallel 8
RUN ctest --test-dir build
@jschueller jschueller added the bug label Sep 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant