Compare commits

..

12 Commits

Author SHA1 Message Date
Peter Dimov 2698b43803 Update revision history 2026-05-12 02:42:47 +03:00
Peter Dimov c745320880 Update .drone.jsonnet 2026-05-12 01:59:03 +03:00
Peter Dimov e32dbe5013 Update ci.yml 2026-05-11 22:46:20 +03:00
Peter Dimov 1e51179fc7 Disable hash_variant_test2 under Clang < 7.1 2026-05-11 22:32:13 +03:00
Peter Dimov 3e27ff182c Avoid libstdc++'s never valueless optimization 2026-05-11 22:08:25 +03:00
Peter Dimov 68fabb1a8e Do not throw an exception when hashing valueless std::variant values 2026-05-11 21:23:29 +03:00
Peter Dimov 8d5ae8536f Add a test for valueless std::variant values 2026-05-11 21:19:32 +03:00
Peter Dimov e3cbbebc8a Remove ubuntu:18.04 from ci.yml 2026-04-01 21:54:57 +03:00
Peter Dimov 12f8284c1a Update .drone.jsonnet 2026-04-01 21:54:57 +03:00
Peter Dimov 07fdcf16cb Update ci.yml 2026-04-01 21:54:57 +03:00
Peter Dimov bd3084a1c9 Update .drone.jsonnet 2026-04-01 21:54:57 +03:00
Peter Dimov 3a0f818eb8 Update ci.yml 2026-04-01 21:54:57 +03:00
6 changed files with 184 additions and 113 deletions
+62 -24
View File
@@ -34,7 +34,6 @@ local linux_pipeline(name, image, environment, packages = "", sources = [], arch
'set -e',
'uname -a',
'echo $DRONE_STAGE_MACHINE',
'wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add -',
] +
(if sources != [] then [ 'apt-get update' ] + [ ('apt-add-repository "' + source + '"') for source in sources ] else []) +
(if packages != "" then [ 'apt-get update', 'apt-get -y install ' + packages ] else []) +
@@ -103,7 +102,6 @@ local windows_pipeline(name, image, environment, arch = "amd64") =
"cppalliance/droneubuntu1404:1",
{ TOOLSET: 'gcc', COMPILER: 'g++-4.7', CXXSTD: '0x', ADDRMD: '32,64' },
"g++-4.7-multilib",
[ "ppa:ubuntu-toolchain-r/test" ],
),
linux_pipeline(
@@ -113,11 +111,10 @@ local windows_pipeline(name, image, environment, arch = "amd64") =
),
linux_pipeline(
"Linux 14.04 GCC 4.9 32/64",
"cppalliance/droneubuntu1404:1",
"Linux 16.04 GCC 4.9 32/64",
"cppalliance/droneubuntu1604:1",
{ TOOLSET: 'gcc', COMPILER: 'g++-4.9', CXXSTD: '11', ADDRMD: '32,64' },
"g++-4.9-multilib",
[ "ppa:ubuntu-toolchain-r/test" ],
),
linux_pipeline(
@@ -214,6 +211,27 @@ local windows_pipeline(name, image, environment, arch = "amd64") =
"g++-14-multilib",
),
linux_pipeline(
"Linux 26.04 GCC 15 UBSAN",
"cppalliance/droneubuntu2604:1",
{ TOOLSET: 'gcc', COMPILER: 'g++-15', CXXSTD: '11,14,17,20,23,2c' } + ubsan,
"g++-15-multilib",
),
linux_pipeline(
"Linux 26.04 GCC 15 ASAN",
"cppalliance/droneubuntu2604:1",
{ TOOLSET: 'gcc', COMPILER: 'g++-15', CXXSTD: '11,14,17,20,23,2c' } + asan,
"g++-15-multilib",
),
linux_pipeline(
"Linux 26.04 GCC 16",
"cppalliance/droneubuntu2604:1",
{ TOOLSET: 'gcc', COMPILER: 'g++-16', CXXSTD: '11,14,17,20,23,2c' },
"g++-16-multilib",
),
linux_pipeline(
"Linux 16.04 Clang 3.5",
"cppalliance/droneubuntu1604:1",
@@ -341,40 +359,54 @@ local windows_pipeline(name, image, environment, arch = "amd64") =
),
linux_pipeline(
"Linux 24.04 Clang 17 UBSAN",
"Linux 24.04 Clang 17",
"cppalliance/droneubuntu2404:1",
{ TOOLSET: 'clang', COMPILER: 'clang++-17', CXXSTD: '11,14,17,20,2b' } + ubsan,
{ TOOLSET: 'clang', COMPILER: 'clang++-17', CXXSTD: '11,14,17,20,2b' },
"clang-17",
),
linux_pipeline(
"Linux 24.04 Clang 17 ASAN",
"Linux 24.04 Clang 18",
"cppalliance/droneubuntu2404:1",
{ TOOLSET: 'clang', COMPILER: 'clang++-17', CXXSTD: '11,14,17,20,2b' } + asan,
"clang-17",
),
linux_pipeline(
"Linux 24.04 Clang 18 UBSAN",
"cppalliance/droneubuntu2404:1",
{ TOOLSET: 'clang', COMPILER: 'clang++-18', CXXSTD: '11,14,17,20,2b' } + ubsan,
{ TOOLSET: 'clang', COMPILER: 'clang++-18', CXXSTD: '11,14,17,20,2b' },
"clang-18",
),
linux_pipeline(
"Linux 24.04 Clang 18 ASAN",
"Linux 24.04 Clang 19",
"cppalliance/droneubuntu2404:1",
{ TOOLSET: 'clang', COMPILER: 'clang++-18', CXXSTD: '11,14,17,20,2b' } + asan,
"clang-18",
),
linux_pipeline(
"Linux 24.10 Clang 19",
"cppalliance/droneubuntu2410:1",
{ TOOLSET: 'clang', COMPILER: 'clang++-19', CXXSTD: '11,14,17,20,2b' },
"clang-19",
),
linux_pipeline(
"Linux 24.04 Clang 20 UBSAN",
"cppalliance/droneubuntu2404:1",
{ TOOLSET: 'clang', COMPILER: 'clang++-20', CXXSTD: '11,14,17,20,23,2c' } + ubsan,
"clang-20",
),
linux_pipeline(
"Linux 24.04 Clang 20 ASAN",
"cppalliance/droneubuntu2404:1",
{ TOOLSET: 'clang', COMPILER: 'clang++-20', CXXSTD: '11,14,17,20,23,2c' } + asan,
"clang-20",
),
linux_pipeline(
"Linux 26.04 Clang 21",
"cppalliance/droneubuntu2604:1",
{ TOOLSET: 'clang', COMPILER: 'clang++-21', CXXSTD: '11,14,17,20,23,2c' },
"clang-21",
),
linux_pipeline(
"Linux 26.04 Clang 22",
"cppalliance/droneubuntu2604:1",
{ TOOLSET: 'clang', COMPILER: 'clang++-22', CXXSTD: '11,14,17,20,23,2c' },
"clang-22",
),
macos_pipeline(
"MacOS 10.15 Xcode 12.2 UBSAN",
{ TOOLSET: 'clang', COMPILER: 'clang++', CXXSTD: '11,14,17,2a' } + ubsan,
@@ -420,4 +452,10 @@ local windows_pipeline(name, image, environment, arch = "amd64") =
"cppalliance/dronevs2022:1",
{ TOOLSET: 'msvc-14.3', CXXSTD: '14,17,20,latest' },
),
windows_pipeline(
"Windows VS2026 msvc-14.5",
"cppalliance/dronevs2026:1",
{ TOOLSET: 'msvc-14.5', CXXSTD: '14,17,20,latest' },
),
]
+53 -88
View File
@@ -17,24 +17,6 @@ jobs:
fail-fast: false
matrix:
include:
- toolset: gcc-4.8
cxxstd: "11"
container: ubuntu:18.04
os: ubuntu-latest
install: g++-4.8-multilib
address-model: 32,64
- toolset: gcc-5
cxxstd: "11,14,1z"
container: ubuntu:18.04
os: ubuntu-latest
install: g++-5-multilib
address-model: 32,64
- toolset: gcc-6
cxxstd: "11,14,1z"
container: ubuntu:18.04
os: ubuntu-latest
install: g++-6-multilib
address-model: 32,64
- toolset: gcc-7
cxxstd: "11,14,17"
container: ubuntu:20.04
@@ -55,17 +37,20 @@ jobs:
address-model: 32,64
- toolset: gcc-10
cxxstd: "11,14,17,2a"
os: ubuntu-22.04
container: ubuntu:22.04
os: ubuntu-latest
install: g++-10-multilib
address-model: 32,64
- toolset: gcc-11
cxxstd: "11,14,17,20"
os: ubuntu-22.04
container: ubuntu:22.04
os: ubuntu-latest
install: g++-11-multilib
address-model: 32,64
- toolset: gcc-12
cxxstd: "11,14,17,20,2b"
os: ubuntu-22.04
container: ubuntu:22.04
os: ubuntu-latest
install: g++-12-multilib
address-model: 32,64
- toolset: gcc-13
@@ -82,28 +67,16 @@ jobs:
address-model: 32,64
- toolset: gcc-15
cxxstd: "11,14,17,20,23,2c"
container: ubuntu:25.04
container: ubuntu:26.04
os: ubuntu-latest
install: g++-15-multilib
address-model: 32,64
- toolset: clang
compiler: clang++-3.9
cxxstd: "11,14"
container: ubuntu:18.04
- toolset: gcc-16
cxxstd: "11,14,17,20,23,2c"
container: ubuntu:26.04
os: ubuntu-latest
install: clang-3.9
- toolset: clang
compiler: clang++-4.0
cxxstd: "11,14"
container: ubuntu:18.04
os: ubuntu-latest
install: clang-4.0
- toolset: clang
compiler: clang++-5.0
cxxstd: "11,14,1z"
container: ubuntu:18.04
os: ubuntu-latest
install: clang-5.0
install: g++-16-multilib
address-model: 32,64
- toolset: clang
compiler: clang++-6.0
cxxstd: "11,14,17"
@@ -191,26 +164,33 @@ jobs:
- toolset: clang
compiler: clang++-20
cxxstd: "11,14,17,20,23,2c"
container: ubuntu:25.04
container: ubuntu:24.04
os: ubuntu-latest
install: clang-20
- toolset: clang
cxxstd: "11,14,17,20,2b"
os: macos-13
compiler: clang++-21
cxxstd: "11,14,17,20,23,2c"
container: ubuntu:26.04
os: ubuntu-latest
install: clang-21
- toolset: clang
compiler: clang++-22
cxxstd: "11,14,17,20,23,2c"
container: ubuntu:26.04
os: ubuntu-latest
install: clang-22
- toolset: clang
cxxstd: "11,14,17,20,2b"
os: macos-14
- toolset: clang
cxxstd: "11,14,17,20,2b"
os: macos-15
- toolset: clang
cxxstd: "11,14,17,20,23,2c"
os: macos-26
runs-on: ${{matrix.os}}
container:
image: ${{matrix.container}}
volumes:
- /node20217:/node20217:rw,rshared
- ${{ startsWith(matrix.container, 'ubuntu:1') && '/node20217:/__e/node20:ro,rshared' || ' ' }}
container: ${{matrix.container}}
defaults:
run:
@@ -223,14 +203,7 @@ jobs:
apt-get update
apt-get -y install sudo python3 git g++ curl xz-utils
- name: Install nodejs20glibc2.17
if: ${{ startsWith( matrix.container, 'ubuntu:1' ) }}
run: |
curl -LO https://archives.boost.io/misc/node/node-v20.9.0-linux-x64-glibc-217.tar.xz
tar -xf node-v20.9.0-linux-x64-glibc-217.tar.xz --strip-components 1 -C /node20217
ldd /__e/node20/bin/node
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- name: Install packages
if: matrix.install
@@ -281,19 +254,23 @@ jobs:
cxxstd: "14,17,20,latest"
addrmd: 32,64
os: windows-2022
- toolset: clang-win
cxxstd: "14,17,latest"
- toolset: msvc-14.5
cxxstd: "14,17,20,latest"
addrmd: 32,64
os: windows-2022
os: windows-2025-vs2026
- toolset: clang-win
cxxstd: "14,17,20,latest"
addrmd: 32,64
os: windows-2025
- toolset: gcc
cxxstd: "11,14,17,2a"
addrmd: 64
os: windows-2022
os: windows-2025
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- name: Setup Boost
shell: cmd
@@ -329,16 +306,13 @@ jobs:
fail-fast: false
matrix:
include:
- os: ubuntu-22.04
- os: ubuntu-24.04
- os: macos-13
- os: macos-14
- os: macos-15
- os: ubuntu-latest
- os: macos-latest
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- name: Install packages
if: matrix.install
@@ -377,16 +351,13 @@ jobs:
fail-fast: false
matrix:
include:
- os: ubuntu-22.04
- os: ubuntu-24.04
- os: macos-13
- os: macos-14
- os: macos-15
- os: ubuntu-latest
- os: macos-latest
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- name: Install packages
if: matrix.install
@@ -435,16 +406,13 @@ jobs:
fail-fast: false
matrix:
include:
- os: ubuntu-22.04
- os: ubuntu-24.04
- os: macos-13
- os: macos-14
- os: macos-15
- os: ubuntu-latest
- os: macos-latest
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- name: Install packages
if: matrix.install
@@ -491,13 +459,12 @@ jobs:
fail-fast: false
matrix:
include:
- os: windows-2022
- os: windows-2025
- os: windows-latest
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- name: Setup Boost
shell: cmd
@@ -540,13 +507,12 @@ jobs:
fail-fast: false
matrix:
include:
- os: windows-2022
- os: windows-2025
- os: windows-latest
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- name: Setup Boost
shell: cmd
@@ -607,13 +573,12 @@ jobs:
fail-fast: false
matrix:
include:
- os: windows-2022
- os: windows-2025
- os: windows-latest
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- name: Setup Boost
shell: cmd
+4
View File
@@ -8,6 +8,10 @@ https://www.boost.org/LICENSE_1_0.txt
= Recent Changes
:idprefix: recent_
== Boost 1.92.0
* Hashing a valueless `std::variant` instance no longer throws.
== Boost 1.89.0
* Added the `hash_is_avalanching` trait class.
+5 -1
View File
@@ -455,7 +455,11 @@ namespace boost
std::size_t seed = 0;
hash_combine( seed, v.index() );
std::visit( [&seed](auto&& x) { hash_combine(seed, x); }, v );
if( !v.valueless_by_exception() )
{
std::visit( [&seed](auto&& x) { hash_combine(seed, x); }, v );
}
return seed;
}
+2
View File
@@ -135,3 +135,5 @@ run hash_tuple_like_test2.cpp
run is_range_test4.cpp ;
run hash_container_test2.cpp ;
run hash_variant_test2.cpp ;
+58
View File
@@ -0,0 +1,58 @@
// Copyright 2026 Peter Dimov
// Distributed under the Boost Software License, Version 1.0.
// https://www.boost.org/LICENSE_1_0.txt
#include <boost/container_hash/hash.hpp>
#include <boost/config.hpp>
#include <boost/config/pragma_message.hpp>
#if defined(BOOST_NO_CXX17_HDR_VARIANT)
BOOST_PRAGMA_MESSAGE( "Skipping test because BOOST_NO_CXX17_HDR_VARIANT is defined" )
int main() {}
#elif defined(BOOST_CLANG_VERSION) && BOOST_CLANG_VERSION < 70100
BOOST_PRAGMA_MESSAGE( "Skipping test because BOOST_CLANG_VERSION < 70100" )
int main() {}
#else
#include <boost/core/lightweight_test.hpp>
#include <variant>
#include <set>
struct X
{
operator std::set<float>() const { throw 5; }
};
using V = std::variant<std::set<int>, std::set<float>>;
V make_valueless_variant()
{
V v;
try
{
v.emplace<1>( X() );
}
catch( int )
{
}
BOOST_TEST( v.valueless_by_exception() );
return v;
}
int main()
{
V v1, v2 = make_valueless_variant();
BOOST_TEST_NE( (boost::hash<V>()( v1 )), (boost::hash<V>()( v2 )) );
return boost::report_errors();
}
#endif