Skip to content

Commit

Permalink
Merge pull request duckdb#11725 from carlopi/c20
Browse files Browse the repository at this point in the history
More docker tests, fix compilation up to C++23 standard
  • Loading branch information
Mytherin authored Apr 19, 2024
2 parents 3cc897f + d188380 commit ddfe1cd
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 7 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ set(DUCKDB_MODULE_BASE_DIR "${CMAKE_CURRENT_LIST_DIR}")

set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

set (CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD "11" CACHE STRING "C++ standard to enforce")

set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
Expand Down
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ ifdef OVERRIDE_GIT_DESCRIBE
else
COMMON_CMAKE_VARS:=${COMMON_CMAKE_VARS} -DOVERRIDE_GIT_DESCRIBE=""
endif
ifneq (${CXX_STANDARD}, )
CMAKE_VARS:=${CMAKE_VARS} -DCMAKE_CXX_STANDARD="${CXX_STANDARD}"
endif
ifneq (${DUCKDB_EXTENSIONS}, )
BUILD_EXTENSIONS:=${DUCKDB_EXTENSIONS}
endif
Expand Down
8 changes: 7 additions & 1 deletion scripts/test_docker_images.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
#!/usr/bin/env bash

make clean
docker run -i --rm -v $(pwd):/duckdb --workdir /duckdb amazonlinux:2 <<< "yum install g++ git make cmake ninja-build -y && GEN=ninja make && make clean" 2>&1
docker run -i --rm -v $(pwd):/duckdb --workdir /duckdb amazonlinux:latest <<< "yum install clang git make cmake ninja-build -y && GEN=ninja make && make clean" 2>&1
docker run -i --rm -v $(pwd):/duckdb --workdir /duckdb alpine:latest <<< "apk add g++ git make cmake ninja && GEN=ninja make && make clean" 2>&1
docker run -i --rm -v $(pwd):/duckdb --workdir /duckdb alpine:latest <<< "apk add g++ git make cmake ninja python3 && GEN=ninja make && make clean" 2>&1
docker run -i --rm -v $(pwd):/duckdb --workdir /duckdb ubuntu:20.04 <<< "apt-get update && export DEBIAN_FRONTEND=noninteractive && apt-get install g++ git make cmake ninja-build python3 -y && GEN=ninja make && make clean" 2>&1
docker run -i --rm -v $(pwd):/duckdb --workdir /duckdb alpine:latest <<< "apk add g++ git make cmake ninja && CXX_STANDARD=23 GEN=ninja make && make clean" 2>&1
docker run -i --rm -v $(pwd):/duckdb --workdir /duckdb ubuntu:20.04 <<< "apt-get update && export DEBIAN_FRONTEND=noninteractive && apt-get install g++ git make cmake ninja-build -y && GEN=ninja make && make clean" 2>&1
docker run -i --rm -v $(pwd):/duckdb --workdir /duckdb ubuntu:devel <<< "apt-get update && export DEBIAN_FRONTEND=noninteractive && apt-get install g++ git make cmake ninja-build -y && GEN=ninja make && make clean" 2>&1
docker run -i --rm -v $(pwd):/duckdb --workdir /duckdb centos <<< "sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-* && sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-* && yum install git make cmake clang -y && make && make clean" 2>&1
6 changes: 3 additions & 3 deletions src/include/duckdb/common/shared_ptr.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ namespace duckdb {

#if _LIBCPP_STD_VER >= 17
template <class U, class T>
struct __bounded_convertible_to_unbounded : false_type {};
struct __bounded_convertible_to_unbounded : std::false_type {};

template <class _Up, std::size_t _Np, class T>
struct __bounded_convertible_to_unbounded<_Up[_Np], T> : is_same<std::remove_cv<T>, _Up[]> {};
struct __bounded_convertible_to_unbounded<_Up[_Np], T> : std::is_same<std::remove_cv<T>, _Up[]> {};

template <class U, class T>
struct compatible_with_t : _Or<std::is_convertible<U *, T *>, __bounded_convertible_to_unbounded<U, T>> {};
struct compatible_with_t : std::_Or<std::is_convertible<U *, T *>, __bounded_convertible_to_unbounded<U, T>> {};
#else
template <class U, class T>
struct compatible_with_t : std::is_convertible<U *, T *> {}; // NOLINT: invalid case style
Expand Down
2 changes: 1 addition & 1 deletion src/include/duckdb/parser/base_expression.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ class BaseExpression {
static bool Equals(const BaseExpression &left, const BaseExpression &right) {
return left.Equals(right);
}
bool operator==(const BaseExpression &rhs) {
bool operator==(const BaseExpression &rhs) const {
return Equals(rhs);
}

Expand Down
2 changes: 1 addition & 1 deletion third_party/mbedtls/library/constant_time.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ int mbedtls_ct_memcmp( const void *a,
* This avoids IAR compiler warning:
* 'the order of volatile accesses is undefined ..' */
unsigned char x = A[i], y = B[i];
diff |= x ^ y;
diff = (diff | (x ^ y));
}

return( (int)diff );
Expand Down

0 comments on commit ddfe1cd

Please sign in to comment.