Skip to content

Commit 61464fc

Browse files
authored
Fix no member named 'construct' in 'optional<type-parameter-0-0 &>' error in sol.hpp with Clang 19 (#7098)
1 parent 6f235cc commit 61464fc

File tree

4 files changed

+18
-14
lines changed

4 files changed

+18
-14
lines changed

.github/workflows/osrm-backend.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -446,14 +446,14 @@ jobs:
446446
if: steps.cache-boost.outputs.cache-hit != 'true' && runner.os == 'Linux' && matrix.ENABLE_CONAN != 'ON'
447447
run: |
448448
BOOST_VERSION="1.85.0"
449-
BOOST_VERSION_UNDERSCORE="${BOOST_VERSION//./_}"
450-
wget -q https://boostorg.jfrog.io/artifactory/main/release/${BOOST_VERSION}/source/boost_${BOOST_VERSION_UNDERSCORE}.tar.gz
451-
tar xzf boost_${BOOST_VERSION_UNDERSCORE}.tar.gz
452-
cd boost_${BOOST_VERSION_UNDERSCORE}
449+
BOOST_VERSION_FLAVOR="${BOOST_VERSION}-b2-nodocs"
450+
wget -q https://github.com/boostorg/boost/releases/download/boost-${BOOST_VERSION}/boost-${BOOST_VERSION_FLAVOR}.tar.gz
451+
tar xzf boost-${BOOST_VERSION_FLAVOR}.tar.gz
452+
cd boost-${BOOST_VERSION}
453453
sudo ./bootstrap.sh
454454
sudo ./b2 install
455455
cd ..
456-
sudo rm -rf boost_${BOOST_VERSION_UNDERSCORE}*
456+
sudo rm -rf boost-${BOOST_VERSION}*
457457
458458
- name: Install dev dependencies
459459
run: |

CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@ endif()
5656
if (POLICY CMP0074)
5757
cmake_policy(SET CMP0074 NEW)
5858
endif()
59+
if (POLICY CMP0167)
60+
cmake_policy(SET CMP0167 NEW)
61+
endif()
5962
project(OSRM C CXX)
6063

6164

docker/Dockerfile-alpine

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
1-
FROM alpine:3.20.5 AS alpine-mimalloc
1+
FROM alpine:3.21.2 AS alpine-mimalloc
22

3-
RUN apk add --no-cache mimalloc
3+
RUN apk update && \
4+
apk upgrade && \
5+
apk add --no-cache \
6+
boost-iostreams \
7+
boost-program_options \
8+
boost-thread \
9+
mimalloc
410

511
ENV LD_PRELOAD=/usr/lib/libmimalloc.so.2
612
ENV MIMALLOC_LARGE_OS_PAGES=1
@@ -14,9 +20,6 @@ RUN mkdir -p /src /opt && \
1420
apk add --no-cache \
1521
boost-dev \
1622
boost-filesystem \
17-
boost-iostreams \
18-
boost-program_options \
19-
boost-thread \
2023
clang \
2124
cmake \
2225
expat-dev \
@@ -59,9 +62,6 @@ COPY --from=builder /opt /opt
5962

6063
RUN apk add --no-cache \
6164
boost-date_time \
62-
boost-iostreams \
63-
boost-program_options \
64-
boost-thread \
6565
expat \
6666
lua5.4 \
6767
onetbb && \

third_party/sol2/include/sol/sol.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6752,7 +6752,8 @@ namespace sol {
67526752
static_assert(std::is_constructible<T, Args&&...>::value, "T must be constructible with Args");
67536753

67546754
*this = nullopt;
6755-
this->construct(std::forward<Args>(args)...);
6755+
new (static_cast<void*>(this)) optional(std::in_place, std::forward<Args>(args)...);
6756+
return **this;
67566757
}
67576758

67586759
/// Swaps this optional with the other.

0 commit comments

Comments
 (0)