Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
b0af665
test(msvc-p0323): isolate the permissive-mode probe
X1aomu Aug 7, 2026
d7eea31
test(msvc-p0323): avoid GCC local-class alias lookup
X1aomu Aug 7, 2026
c58329b
test(msvc-p0323): preserve braced-value coverage
X1aomu Aug 7, 2026
296e612
build(msvc-p0323): enable on recent GCC and Clang
X1aomu Aug 7, 2026
105dd09
build(msvc-p2505): enable on recent GCC and Clang
X1aomu Aug 7, 2026
1fe914f
fix: allow constexpr destruction with Clang
X1aomu Aug 7, 2026
0a38e81
test: add configurable ASan and UBSan support
X1aomu Aug 7, 2026
421cd54
test(msvc): match Catch2 STL annotations under ASan
X1aomu Aug 7, 2026
10f1b38
test: cover converting expected resource lifetime
X1aomu Aug 6, 2026
b4678d4
test: cover converting expected alternative construction
X1aomu Aug 10, 2026
c779882
fix: avoid double construction in converting expected
X1aomu Aug 6, 2026
5248f3b
test: cover constructor exception lifetimes
X1aomu Aug 6, 2026
1646473
test: cover both alternatives on construction failure
X1aomu Aug 6, 2026
c9e97c8
test: cover void expected conversion exceptions
X1aomu Aug 10, 2026
f3048c1
fix: construct expected alternatives in storage
X1aomu Aug 6, 2026
262e0bc
fix(msvc): preserve source alternative value categories
X1aomu Aug 7, 2026
743cb0f
refactor: remove unused expected construction helpers
X1aomu Aug 10, 2026
ac5c55c
test: cover assignment exception rollback
X1aomu Aug 10, 2026
4bd9a6b
test: cover swap exception rollback
X1aomu Aug 10, 2026
bb1cc3e
ci: update checkout action to v7
X1aomu Aug 7, 2026
303dd72
ci: disable automatic sanitizers in regular tests
X1aomu Aug 7, 2026
2e202b8
ci: add sanitizer test matrix
X1aomu Aug 7, 2026
e4fa521
doc: update compiler support table
X1aomu Aug 10, 2026
71360d8
doc: update project description
X1aomu Aug 10, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
146 changes: 146 additions & 0 deletions .github/workflows/sanitizers.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
name: Sanitizers

on:
workflow_dispatch:
push:
branches:
- main
- ci/**
pull_request:
branches:
- main

permissions:
contents: read

jobs:
test-on-msvc:
strategy:
fail-fast: false

matrix:
build-type: [Debug, Release]
include:
- build-type: Debug
cmake-preset: conan-debug
- build-type: Release
cmake-preset: conan-release

name: MSVC v143 - ASan - ${{ matrix.build-type }}

runs-on: windows-2022

steps:
- uses: actions/checkout@v7

- name: Setup MSVC developer environment
uses: TheMrMilchmann/setup-msvc-dev@v4
with:
arch: x64

- name: Install Conan
uses: turtlebrowser/get-conan@main

- name: Setup Conan
run: |
conan --version
conan profile detect

- name: Install CMake
uses: lukka/get-cmake@latest

- name: Install dependencies
run: >
conan install .
-c tools.microsoft.msbuild:vs_version=17
-s compiler.version=194
-s compiler.cppstd=23
-s build_type=${{ matrix.build-type }}
-b missing

- name: CMake Configure
run: >
cmake --preset conan-default
-DZEUS_EXPECTED_TEST_ASAN_REQUIRED=ON

- name: Build
run: cmake --build --preset ${{ matrix.cmake-preset }}

- name: Test
run: ctest --preset ${{ matrix.cmake-preset }} --output-on-failure

test-on-linux:
strategy:
fail-fast: false

matrix:
compiler:
- name: GCC 15
id: gcc
version: 15
cc: gcc-15
cxx: g++-15
- name: Clang 22
id: clang
version: 22
cc: clang-22
cxx: clang++-22
build-type: [Debug, Release]
include:
- build-type: Debug
cmake-preset: conan-debug
- build-type: Release
cmake-preset: conan-release

name: ${{ matrix.compiler.name }} - ASan + UBSan - ${{ matrix.build-type }}

runs-on: ubuntu-24.04

env:
CC: ${{ matrix.compiler.cc }}
CXX: ${{ matrix.compiler.cxx }}

steps:
- uses: actions/checkout@v7

- name: Setup GCC
if: matrix.compiler.id == 'gcc'
uses: egor-tensin/setup-gcc@v2
with:
version: ${{ matrix.compiler.version }}

- name: Setup Clang
if: matrix.compiler.id == 'clang'
uses: egor-tensin/setup-clang@v2
with:
version: ${{ matrix.compiler.version }}

- name: Install Conan
uses: turtlebrowser/get-conan@main

- name: Setup Conan
run: |
conan --version
conan profile detect --force

- name: Install CMake
uses: lukka/get-cmake@latest

- name: Install dependencies
run: >
conan install .
-s compiler.cppstd=23
-s build_type=${{ matrix.build-type }}
-b missing

- name: CMake Configure
run: >
cmake --preset ${{ matrix.cmake-preset }}
-DZEUS_EXPECTED_TEST_ASAN_REQUIRED=ON
-DZEUS_EXPECTED_TEST_UBSAN_REQUIRED=ON

- name: Build
run: cmake --build --preset ${{ matrix.cmake-preset }}

- name: Test
run: ctest --preset ${{ matrix.cmake-preset }} --output-on-failure
20 changes: 10 additions & 10 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
runs-on: windows-2022

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v7

- name: Install Conan
uses: turtlebrowser/get-conan@main
Expand All @@ -62,7 +62,7 @@ jobs:
- name: CMake Configure
run: |
cmake --list-presets
cmake --preset conan-default
cmake --preset conan-default -DZEUS_EXPECTED_TEST_ASAN_AUTO=OFF -DZEUS_EXPECTED_TEST_UBSAN_AUTO=OFF

- name: Build
run: |
Expand Down Expand Up @@ -99,7 +99,7 @@ jobs:
runs-on: ${{ matrix.gcc.os }}

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v7

- name: Setup GCC
if: matrix.gcc.version == 15
Expand Down Expand Up @@ -134,7 +134,7 @@ jobs:
- name: CMake Configure
run: |
cmake --list-presets
cmake --preset ${{ matrix.cmake-preset }}
cmake --preset ${{ matrix.cmake-preset }} -DZEUS_EXPECTED_TEST_ASAN_AUTO=OFF -DZEUS_EXPECTED_TEST_UBSAN_AUTO=OFF

- name: Build
run: |
Expand Down Expand Up @@ -185,7 +185,7 @@ jobs:
python3-pip \
unzip

- uses: actions/checkout@v4
- uses: actions/checkout@v7

- name: Check GCC Version
run: |
Expand Down Expand Up @@ -214,7 +214,7 @@ jobs:
- name: CMake Configure
run: |
cmake --list-presets
cmake --preset ${{ matrix.cmake-preset }}
cmake --preset ${{ matrix.cmake-preset }} -DZEUS_EXPECTED_TEST_ASAN_AUTO=OFF -DZEUS_EXPECTED_TEST_UBSAN_AUTO=OFF

- name: Build
run: |
Expand Down Expand Up @@ -252,7 +252,7 @@ jobs:
CXX: clang++-${{ matrix.clang-version }}

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v7

- name: Install Clang
uses: egor-tensin/setup-clang@v2
Expand Down Expand Up @@ -294,7 +294,7 @@ jobs:
- name: CMake Configure
run: |
cmake --list-presets
cmake --preset ${{ matrix.cmake-preset }}
cmake --preset ${{ matrix.cmake-preset }} -DZEUS_EXPECTED_TEST_ASAN_AUTO=OFF -DZEUS_EXPECTED_TEST_UBSAN_AUTO=OFF

- name: Build
run: |
Expand Down Expand Up @@ -326,7 +326,7 @@ jobs:
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v7

- name: Setup GCC
uses: egor-tensin/setup-gcc@v1
Expand Down Expand Up @@ -360,7 +360,7 @@ jobs:
- name: CMake Configure
run: |
cmake --list-presets
cmake --preset ${{ matrix.cmake-preset }}
cmake --preset ${{ matrix.cmake-preset }} -DZEUS_EXPECTED_TEST_ASAN_AUTO=OFF -DZEUS_EXPECTED_TEST_UBSAN_AUTO=OFF

- name: Build
run: |
Expand Down
19 changes: 9 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
[![GitHub Release](https://img.shields.io/github/v/release/zeus-cpp/expected?color=green)](https://github.com/zeus-cpp/expected/releases)
[![Conan Center](https://img.shields.io/conan/v/zeus_expected)](https://conan.io/center/recipes/zeus_expected)

Backporting `std::expected` to C++17.
A C++17 backport of `std::expected`, designed for API compatibility with the standard library.

## Features

Expand Down Expand Up @@ -32,18 +32,17 @@ Enhancements:

+ Enhanced noexcept (covered by tests from MSVC's STL)

## Compiler supports
## Compiler support

Any compiler that supports C++17 should work.
A conforming C++17 implementation is required. Higher language standards are also supported and can provide benefits such as enhanced constexpr capabilities.

Higher language standards are also supported, which can provide benefits such as enhanced constexpr capabilities.
| Compiler | Supported versions |
| --- | --- |
| MSVC | v142 and later |
| GCC | 8 and later |
| Clang | 11 and later |

List of known compiler supported:

+ MSVC v142 and later
+ GCC 8 and later

Feedbacks are welcome.
See the [CI workflow](.github/workflows/tests.yml) for the compiler and language standard combinations that are continuously tested. Other conforming compilers may also work. Feedback is welcome.

## Building and testing

Expand Down
Loading