Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add gcc-11...gcc-13 #573

Merged
merged 2 commits into from
Oct 20, 2023
Merged
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
119 changes: 119 additions & 0 deletions .github/workflows/libunifex-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,96 @@ jobs:
cc: "gcc-10", cxx: "g++-10",
cmake_args: "-D CMAKE_CXX_STANDARD:STRING=20 -D CMAKE_CXX_FLAGS:STRING=-fcoroutines"
}
- {
name: "Linux GCC 11 Debug (C++17)", artifact: "Linux.tar.xz",
os: ubuntu-20.04,
io_sys: io_uring,
build_type: Debug,
cc: "gcc-11", cxx: "g++-11"
}
- {
name: "Linux GCC 11 Optimised (C++17)", artifact: "Linux.tar.xz",
os: ubuntu-20.04,
io_sys: io_uring,
build_type: RelWithDebInfo,
cc: "gcc-11", cxx: "g++-11"
}
- {
name: "Linux GCC 11 Debug (C++20)", artifact: "Linux.tar.xz",
os: ubuntu-20.04,
io_sys: io_uring,
build_type: Debug,
cc: "gcc-11", cxx: "g++-11",
cmake_args: "-D CMAKE_CXX_STANDARD:STRING=20"
}
- {
name: "Linux GCC 11 Optimised (C++20)", artifact: "Linux.tar.xz",
os: ubuntu-20.04,
io_sys: io_uring,
build_type: RelWithDebInfo,
cc: "gcc-11", cxx: "g++-11",
cmake_args: "-D CMAKE_CXX_STANDARD:STRING=20"
}
- {
name: "Linux GCC 12 Debug (C++17)", artifact: "Linux.tar.xz",
os: ubuntu-22.04,
io_sys: io_uring,
build_type: Debug,
cc: "gcc-12", cxx: "g++-12"
}
- {
name: "Linux GCC 12 Optimised (C++17)", artifact: "Linux.tar.xz",
os: ubuntu-22.04,
io_sys: io_uring,
build_type: RelWithDebInfo,
cc: "gcc-12", cxx: "g++-12"
}
- {
name: "Linux GCC 12 Debug (C++20)", artifact: "Linux.tar.xz",
os: ubuntu-22.04,
io_sys: io_uring,
build_type: Debug,
cc: "gcc-12", cxx: "g++-12",
cmake_args: "-D CMAKE_CXX_STANDARD:STRING=20"
}
- {
name: "Linux GCC 12 Optimised (C++20)", artifact: "Linux.tar.xz",
os: ubuntu-22.04,
io_sys: io_uring,
build_type: RelWithDebInfo,
cc: "gcc-12", cxx: "g++-12",
cmake_args: "-D CMAKE_CXX_STANDARD:STRING=20"
}
- {
name: "Linux GCC 13 Debug (C++17)", artifact: "Linux.tar.xz",
os: ubuntu-22.04,
io_sys: io_uring,
build_type: Debug,
cc: "gcc-13", cxx: "g++-13"
}
- {
name: "Linux GCC 13 Optimised (C++17)", artifact: "Linux.tar.xz",
os: ubuntu-22.04,
io_sys: io_uring,
build_type: RelWithDebInfo,
cc: "gcc-13", cxx: "g++-13"
}
- {
name: "Linux GCC 13 Debug (C++20)", artifact: "Linux.tar.xz",
os: ubuntu-22.04,
io_sys: io_uring,
build_type: Debug,
cc: "gcc-13", cxx: "g++-13",
cmake_args: "-D CMAKE_CXX_STANDARD:STRING=20"
}
- {
name: "Linux GCC 13 Optimised (C++20)", artifact: "Linux.tar.xz",
os: ubuntu-22.04,
io_sys: io_uring,
build_type: RelWithDebInfo,
cc: "gcc-13", cxx: "g++-13",
cmake_args: "-D CMAKE_CXX_STANDARD:STRING=20"
}
- {
name: "Linux Clang 10 Debug (C++17)", artifact: "Linux.tar.xz",
os: ubuntu-20.04,
Expand Down Expand Up @@ -519,6 +609,35 @@ jobs:
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 16
- name: Install GCC 11
id: install_gcc_11
if: startsWith(matrix.config.os, 'ubuntu') && ( matrix.config.cxx == 'g++-11' )
shell: bash
working-directory: ${{ env.HOME }}
run: |
sudo add-apt-repository ppa:ubuntu-toolchain-r/ppa -y
sudo apt update
sudo apt install g++-11 gcc-11

- name: Install GCC 12
id: install_gcc_12
if: startsWith(matrix.config.os, 'ubuntu') && ( matrix.config.cxx == 'g++-12' )
shell: bash
working-directory: ${{ env.HOME }}
run: |
sudo add-apt-repository ppa:ubuntu-toolchain-r/ppa -y
sudo apt update
sudo apt install g++-12 gcc-12

- name: Install GCC 13
id: install_gcc_13
if: startsWith(matrix.config.os, 'ubuntu') && ( matrix.config.cxx == 'g++-13' )
shell: bash
working-directory: ${{ env.HOME }}
run: |
sudo add-apt-repository ppa:ubuntu-toolchain-r/ppa -y
sudo apt update
sudo apt install g++-13 gcc-13

- name: Install liburing
id: install_liburing
Expand Down
6 changes: 1 addition & 5 deletions cmake/CMakeLists.txt.in
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,7 @@ project(googletest-download NONE)
include(ExternalProject)
ExternalProject_Add(googletest
GIT_REPOSITORY https://github.com/google/googletest.git
# This is a commit after release-1.10.0 for which
# gmock understands noexcept function qualifiers
# and for which usage of std::result_of has been
# discontinued.
GIT_TAG aa9b44a18678dfdf57089a5ac22c1edb69f35da5
GIT_TAG v1.14.0
SOURCE_DIR "${CMAKE_CURRENT_BINARY_DIR}/googletest-src"
BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/googletest-build"
CONFIGURE_COMMAND ""
Expand Down
12 changes: 6 additions & 6 deletions examples/linux/io_epoll_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,10 @@ using namespace unifex;
using namespace unifex::linuxos;
using namespace std::chrono_literals;

inline constexpr auto sink = [](auto&&...){};

inline constexpr auto discard = then(sink);
template<typename S>
auto discard_value(S&& s) {
return then((S&&)s, [](auto&&...) noexcept {});
}

//! Seconds to warmup the benchmark
static constexpr int WARMUP_DURATION = 3;
Expand Down Expand Up @@ -107,8 +108,7 @@ int main() {
return
// do read:
async_read_some(rPipeRef, as_writable_bytes(span{buffer.data() + 0, 1}))
| discard
| then([&] {
| then([&](auto&&...) {
UNIFEX_ASSERT(data[(reps + offset) % sizeof(data)] == buffer[0]);
++reps;
});
Expand All @@ -128,7 +128,7 @@ int main() {
// write the data to one end of the pipe
sequence(
just_from([&]{ printf("writes starting!\n"); }),
defer([&, databuffer] { return discard(async_write_some(wPipeRef, databuffer)); })
defer([&, databuffer] { return discard_value(async_write_some(wPipeRef, databuffer)); })
| via(scheduler)
| repeat_effect()
| let_done([]{return just();})
Expand Down
9 changes: 3 additions & 6 deletions include/unifex/detail/with_forwarding_tag_invoke.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,7 @@ namespace unifex
struct _with_forwarding_tag_invoke<Derived, CPO, Ret(Args...)> {
struct type {
friend Ret tag_invoke(CPO cpo, replace_this_t<Args, Derived>... args) {
auto& wrapper = extract_this<Args...>{}(args...);
auto& wrapped = get_wrapped_object(wrapper);
auto& wrapped = get_wrapped_object(extract_this<Args...>{}(args...));
return static_cast<CPO&&>(cpo)(replace_this<Args>::get(
static_cast<decltype(args)&&>(args), wrapped)...);
}
Expand All @@ -72,14 +71,12 @@ namespace unifex
struct type {
friend Ret
tag_invoke(CPO cpo, replace_this_t<Args, Derived>... args) noexcept {
auto& wrapper = extract_this<Args...>{}(args...);
auto& wrapped = get_wrapped_object(wrapper);
auto& wrapped = get_wrapped_object(extract_this<Args...>{}(args...));

// Sanity check that all of the component expressions here are
// noexcept so we don't end up with exception tables being generated
// for this function.
static_assert(noexcept(extract_this<Args...>{}(args...)));
static_assert(noexcept(get_wrapped_object(wrapper)));
static_assert(noexcept(get_wrapped_object(extract_this<Args...>{}(args...))));
static_assert(
noexcept(static_cast<CPO&&>(cpo)(replace_this<Args>::get(
static_cast<decltype(args)&&>(args), wrapped)...)));
Expand Down
9 changes: 4 additions & 5 deletions include/unifex/detail/with_type_erased_tag_invoke.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,15 @@ namespace unifex
static_assert(
!NoExcept ||
noexcept(extract_this<Args...>{}((decltype(args)&&)args...)));
auto&& t = extract_this<Args...>{}((decltype(args)&&)args...);
void* objPtr = get_object_address(t);
auto* fnPtr = get_vtable(t)->template get<CPO>();
void* objPtr = get_object_address(extract_this<Args...>{}((decltype(args)&&)args...));
auto* fnPtr = get_vtable(extract_this<Args...>{}((decltype(args)&&)args...))->template get<CPO>();

// Sanity check that all of the component expressions here are
// noexcept so we don't end up with exception tables being generated
// for this function.
static_assert(!NoExcept || noexcept(get_object_address(t)));
static_assert(!NoExcept || noexcept(get_object_address(extract_this<Args...>{}((decltype(args)&&)args...))));
static_assert(
!NoExcept || noexcept(get_vtable(t)->template get<CPO>()));
!NoExcept || noexcept(get_vtable(extract_this<Args...>{}((decltype(args)&&)args...))->template get<CPO>()));
static_assert(
!NoExcept ||
noexcept(fnPtr(
Expand Down
5 changes: 2 additions & 3 deletions test/async_scope_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -383,9 +383,8 @@ TEST_F(async_scope_test, attach_connect) {
}

TEST_F(async_scope_test, attach_copy) {
mock_receiver<void()> receiver;
EXPECT_CALL(*receiver, set_value()).Times(2);
auto sender1 = scope.attach(just());
auto receiver = UnstoppableSimpleIntReceiver{};
auto sender1 = scope.attach(just(42));
// both senders are attached
auto sender2 = sender1;

Expand Down
8 changes: 4 additions & 4 deletions test/async_scope_v2_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ template <bool ThrowOnCopy, bool ThrowOnMove>
struct custom_receiver final {
custom_receiver() noexcept = default;

custom_receiver(const custom_receiver&) noexcept(!ThrowOnCopy) = default;
custom_receiver(const custom_receiver&) noexcept(!ThrowOnCopy) {}

custom_receiver(custom_receiver&&) noexcept(!ThrowOnMove) = default;
custom_receiver(custom_receiver&&) noexcept(!ThrowOnMove) {}

~custom_receiver() = default;

Expand Down Expand Up @@ -235,8 +235,8 @@ TEST_F(
nest_of_just_of_newtype_has_expected_static_properties) {
struct newtype {
newtype() = default;
newtype(const newtype&) noexcept(false) = default;
newtype(newtype&&) noexcept(false) = default;
newtype(const newtype&) noexcept(false) {}
newtype(newtype&&) noexcept(false) {}
~newtype() = default;
};

Expand Down
4 changes: 2 additions & 2 deletions test/nest_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,9 @@ struct throwing_sender final {

static constexpr bool sends_done = false;

throwing_sender() noexcept(false) = default;
throwing_sender() noexcept(false) {}

throwing_sender(const throwing_sender&) noexcept(false) = default;
throwing_sender(const throwing_sender&) noexcept(false) {}

~throwing_sender() = default;

Expand Down
Loading