Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
37 changes: 25 additions & 12 deletions .github/workflows/cpp-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,21 @@ jobs:
include:
- os: macos-13
triplet: x64-macos
- os: macos-13
compiler: clang
triplet: x64-macos
install: |
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1 brew install llvm@16
- os: ubuntu-22.04
triplet: x64-linux
- os: ubuntu-22.04
triplet: x64-linux
compiler: clang
install: |
sudo cp tools/llvm-snapshot.gpg.key.asc /etc/apt/trusted.gpg.d/llvm-snapshot.asc
sudo add-apt-repository "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-16 main"
sudo apt-get -qq update
sudo apt-get -qq -y install clang-16
- os: windows-2022
triplet: x64-windows

Expand All @@ -37,17 +50,19 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Install required packages / compilers
if: ${{ matrix.install }}
run: ${{ matrix.install }}

- uses: lukka/get-cmake@latest
with:
cmakeVersion: 3.22.6

- name: Initialize vcpkg
uses: lukka/run-vcpkg@v10
uses: lukka/run-vcpkg@dev/vcpkgconfjson-support
with:
vcpkgDirectory: ${{ github.workspace }}/build/vcpkg
vcpkgGitCommitId: f6a5d4e8eb7476b8d7fc12a56dff300c1c986131
prependedCacheKey: compiler=${{ matrix.compiler }}
#appendedCacheKey: r00
vcpkgConfigurationJsonGlob: '**/vcpkg-configuration.json'

- name: Build ${{ matrix.triplet }}-${{ matrix.compiler }} preset
uses: lukka/run-cmake@v10
Expand Down Expand Up @@ -83,24 +98,22 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: "Install clang-tools-15"
- name: "Install clang-tools-16"
run: |
sudo cp ${{ github.workspace }}/tools/llvm-snapshot.gpg.key.asc /etc/apt/trusted.gpg.d/llvm-snapshot.asc
sudo add-apt-repository "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-15 main"
sudo add-apt-repository "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-16 main"
sudo apt-get -qq update
sudo apt-get -qq -y install clang-15 clang-tidy-15 clang-format-15
sudo apt-get -qq -y install clang-16 clang-tidy-16 clang-format-16

- uses: lukka/get-cmake@latest
with:
cmakeVersion: 3.22.6

- name: Initialize vcpkg
uses: lukka/run-vcpkg@v10
uses: lukka/run-vcpkg@dev/vcpkgconfjson-support
with:
vcpkgDirectory: ${{ github.workspace }}/../vcpkg
vcpkgGitCommitId: f6a5d4e8eb7476b8d7fc12a56dff300c1c986131
prependedCacheKey: compiler=clang-15
#appendedCacheKey: r00
vcpkgConfigurationJsonGlob: '**/vcpkg-configuration.json'

- name: Configure x64-linux-clang preset
uses: lukka/run-cmake@v10
Expand All @@ -113,7 +126,7 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
version: 15.0.7
version: 16.0.6
style: file # use .clang-format settings
tidy-checks: '' # use .clang-tidy settings
extensions: cpp,hpp
Expand Down
12 changes: 6 additions & 6 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,8 @@
"x64-linux"
],
"cacheVariables": {
"VCPKG_TARGET_TRIPLET": "x64-linux-clang",
"VCPKG_CHAINLOAD_TOOLCHAIN_FILE": "${sourceDir}/tools/toolchains/x64-linux-clang.cmake"
"VCPKG_TARGET_TRIPLET": "x64-linux-clang-16",
"VCPKG_CHAINLOAD_TOOLCHAIN_FILE": "${sourceDir}/tools/toolchains/x64-linux-clang-16.cmake"
}
},
{
Expand All @@ -136,8 +136,8 @@
"x64-linux-clang"
],
"cacheVariables": {
"VCPKG_TARGET_TRIPLET": "x64-linux-clang-15",
"VCPKG_CHAINLOAD_TOOLCHAIN_FILE": "${sourceDir}/tools/toolchains/x64-linux-clang-15.cmake",
"VCPKG_TARGET_TRIPLET": "x64-linux-clang-16",
"VCPKG_CHAINLOAD_TOOLCHAIN_FILE": "${sourceDir}/tools/toolchains/x64-linux-clang-16.cmake",
"CMAKE_EXPORT_COMPILE_COMMANDS": true
}
},
Expand Down Expand Up @@ -171,8 +171,8 @@
"name": "x64-macos-clang",
"inherits": [ "x64-macos" ],
"cacheVariables": {
"VCPKG_TARGET_TRIPLET": "x64-osx-clang-15-brew",
"VCPKG_CHAINLOAD_TOOLCHAIN_FILE": "${sourceDir}/tools/toolchains/x64-macos-clang-15-brew.cmake"
"VCPKG_TARGET_TRIPLET": "x64-osx-clang-16-brew",
"VCPKG_CHAINLOAD_TOOLCHAIN_FILE": "${sourceDir}/tools/toolchains/x64-macos-clang-16-brew.cmake"
}
},
{
Expand Down
2 changes: 0 additions & 2 deletions src/dplx/cncr/data_defined_status_domain.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,6 @@ class data_defined_status_domain_type : public system_error::status_code_domain
{
template <class DomainType>
friend class system_error::status_code;
template <class StatusCode>
friend class system_error::detail::indirecting_domain;

public:
using value_type = Enum;
Expand Down
10 changes: 10 additions & 0 deletions src/dplx/cncr/data_defined_status_domain.test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@

#include <catch2/catch_test_macros.hpp>
#include <catch2/generators/catch_generators.hpp>
#include <status-code/nested_status_code.hpp>
#include <status-code/quick_status_code_from_enum.hpp>
#include <status-code/system_code.hpp>

#include "test_utils.hpp"

Expand Down Expand Up @@ -113,4 +115,12 @@ TEST_CASE("data defined domain returns the correct description")
CHECK(std::string_view(test_code(code).message().data()) == description);
}

TEST_CASE("data defined domain can be put on the heap")
{
cncr::system_error::system_code const subject
= cncr::system_error::make_nested_status_code(
test_code{test_errc::perm});
CHECK(subject == test_errc::perm);
}

} // namespace cncr_tests
8 changes: 4 additions & 4 deletions src/dplx/cncr/disappointment.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,17 @@ template <typename T>
struct status_code_throw_policy
: outcome::experimental::policy::status_code_throw<
T,
system_error::errored_status_code<system_error::erased<
typename system_error::system_code::value_type>>,
system_error::erased_errored_status_code<
typename system_error::system_code::value_type>,
void>
{
};

template <typename R>
using result = outcome::experimental::status_result<
R,
system_error::errored_status_code<system_error::erased<
typename system_error::system_code::value_type>>,
system_error::erased_errored_status_code<
typename system_error::system_code::value_type>,
status_code_throw_policy<R>>;

} // namespace dplx
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
set(CMAKE_SYSTEM_PROCESSOR AMD64)

set(CMAKE_C_COMPILER clang-15)
set(CMAKE_CXX_COMPILER clang++-15)
set(CMAKE_C_COMPILER clang-16)
set(CMAKE_CXX_COMPILER clang++-16)

set(CMAKE_C_STANDARD 17)
set(CMAKE_CXX_STANDARD 20)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
set(CMAKE_SYSTEM_PROCESSOR AMD64)

execute_process(COMMAND brew --prefix llvm@15 OUTPUT_VARIABLE BREW_LLVM_PATH OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process(COMMAND brew --prefix llvm@16 OUTPUT_VARIABLE BREW_LLVM_PATH OUTPUT_STRIP_TRAILING_WHITESPACE)

set(CMAKE_C_COMPILER "${BREW_LLVM_PATH}/bin/clang")
set(CMAKE_CXX_COMPILER "${BREW_LLVM_PATH}/bin/clang++")
set(CMAKE_OSX_SYSROOT /Applications/Xcode_14.3.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk)
set(CMAKE_OSX_SYSROOT /Applications/Xcode_15.0.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk)

set(CMAKE_C_STANDARD 17)
set(CMAKE_CXX_STANDARD 20)

set(CMAKE_CXX_FLAGS_INIT "-fsized-deallocation -fexperimental-library")
set(CMAKE_CXX_FLAGS_INIT "-fsized-deallocation")
2 changes: 1 addition & 1 deletion tools/toolchains/x64-macos-gcc-12.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ set(CMAKE_SYSTEM_PROCESSOR AMD64)

set(CMAKE_C_COMPILER gcc-12)
set(CMAKE_CXX_COMPILER g++-12)
set(CMAKE_OSX_SYSROOT /Applications/Xcode_14.3.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk)
set(CMAKE_OSX_SYSROOT /Applications/Xcode_15.0.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk)

set(CMAKE_C_STANDARD 17)
set(CMAKE_CXX_STANDARD 20)
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ set(VCPKG_CRT_LINKAGE dynamic)
set(VCPKG_LIBRARY_LINKAGE static)

set(VCPKG_CMAKE_SYSTEM_NAME Linux)
set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE "${CMAKE_CURRENT_LIST_DIR}/../toolchains/x64-linux-clang-15.cmake")
set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE "${CMAKE_CURRENT_LIST_DIR}/../toolchains/x64-linux-clang-16.cmake")
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,8 @@ set(VCPKG_LIBRARY_LINKAGE static)

set(VCPKG_CMAKE_SYSTEM_NAME Darwin)
set(VCPKG_OSX_ARCHITECTURES x86_64)
set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE "${CMAKE_CURRENT_LIST_DIR}/../toolchains/x64-macos-clang-15-brew.cmake")
set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE "${CMAKE_CURRENT_LIST_DIR}/../toolchains/x64-macos-clang-16-brew.cmake")

if(PORT STREQUAL "status-code")
set(VCPKG_CMAKE_CONFIGURE_OPTIONS "-DBUILD_TESTING=OFF")
endif()
2 changes: 1 addition & 1 deletion vcpkg-configuration.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"$schema": "https://raw.githubusercontent.com/microsoft/vcpkg-tool/main/docs/vcpkg-configuration.schema.json",
"default-registry": {
"kind": "builtin",
"baseline": "f6a5d4e8eb7476b8d7fc12a56dff300c1c986131"
"baseline": "a42af01b72c28a8e1d7b48107b33e4f286a55ef6"
},
"registries": [
{
Expand Down