Compare commits

...

8 Commits

Author SHA1 Message Date
e7ed9918c1 Remove C++03 CI jobs, use gcc-11 libstdc++ in clang-12 through 15. 2023-11-17 20:05:19 +03:00
becbd39cc4 Switch to boost::core::invoke_swap.
boost::swap is deprecated and will be removed. Use boost::core::invoke_swap
as a replacement.
2023-09-03 00:24:44 +03:00
28ba36fd3a Add clang-16 CI jobs, switch to clang-15 from stock Ubuntu repos. 2023-06-05 03:16:14 +03:00
8ce66ab37e Updated to GHA checkout@v3 to avoid deprecation warnings. 2022-10-18 17:57:33 +03:00
d4157bdf38 GitHub Actions config update.
- Added gcc-12 and clang-14 through 15 jobs.
- Added C++23 testing for gcc and clang on Linux.
- Updated clang version for UBSAN job.
- Updated Ubuntu version for clang jobs to avoid having to use external APT
  repository.
- Updated python package installation for compatibility with Ubuntu 22.04.
2022-09-10 01:21:36 +03:00
721fe9f562 Switched gcc-9 to ubuntu-20.04 GHA CI image. 2022-08-14 17:52:55 +03:00
88457d2de5 Replaced ubuntu-18.04 GHA CI images with containers.
Also use ubuntu-latest image for jobs that are running in a container.
2022-08-14 13:55:47 +03:00
d22bf3ea37 Switch to macos-11 GHA image as macos-10.15 is deprecated. 2022-08-12 15:59:03 +03:00
3 changed files with 132 additions and 100 deletions

View File

@ -1,4 +1,4 @@
# Copyright 2021 Andrey Semashev
# Copyright 2021-2023 Andrey Semashev
#
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at http://boost.org/LICENSE_1_0.txt)
@ -33,231 +33,260 @@ jobs:
matrix:
include:
# Linux, gcc
- toolset: gcc-4.4
cxxstd: "98,0x"
os: ubuntu-20.04
container: ubuntu:16.04
install:
- g++-4.4
sources:
- "ppa:ubuntu-toolchain-r/test"
- toolset: gcc-4.6
cxxstd: "03,0x"
os: ubuntu-20.04
cxxstd: "0x"
os: ubuntu-latest
container: ubuntu:16.04
install:
- g++-4.6
sources:
- "ppa:ubuntu-toolchain-r/test"
- toolset: gcc-4.7
cxxstd: "03,11"
os: ubuntu-20.04
cxxstd: "11"
os: ubuntu-latest
container: ubuntu:16.04
install:
- g++-4.7
- toolset: gcc-4.8
cxxstd: "03,11"
os: ubuntu-18.04
cxxstd: "11"
os: ubuntu-latest
container: ubuntu:18.04
install:
- g++-4.8
- toolset: gcc-4.9
cxxstd: "03,11"
os: ubuntu-20.04
cxxstd: "11"
os: ubuntu-latest
container: ubuntu:16.04
install:
- g++-4.9
- toolset: gcc-5
cxxstd: "03,11,14,1z"
os: ubuntu-20.04
cxxstd: "11,14,1z"
os: ubuntu-latest
container: ubuntu:16.04
install:
- g++-5
- toolset: gcc-6
cxxstd: "03,11,14,1z"
os: ubuntu-18.04
cxxstd: "11,14,1z"
os: ubuntu-latest
container: ubuntu:18.04
install:
- g++-6
- toolset: gcc-7
cxxstd: "03,11,14,17"
os: ubuntu-18.04
cxxstd: "11,14,17"
os: ubuntu-latest
container: ubuntu:18.04
install:
- g++-7
- toolset: gcc-8
cxxstd: "03,11,14,17,2a"
os: ubuntu-18.04
cxxstd: "11,14,17,2a"
os: ubuntu-latest
container: ubuntu:18.04
install:
- g++-8
- toolset: gcc-9
cxxstd: "03,11,14,17,2a"
os: ubuntu-18.04
cxxstd: "11,14,17,2a"
os: ubuntu-20.04
install:
- g++-9
- toolset: gcc-10
cxxstd: "03,11,14,17,20"
cxxstd: "11,14,17,20"
os: ubuntu-20.04
install:
- g++-10
- toolset: gcc-11
cxxstd: "03-gnu,11-gnu,14-gnu,17-gnu,20-gnu"
os: ubuntu-20.04
cxxstd: "03-gnu,11-gnu,14-gnu,17-gnu,20-gnu,23-gnu"
os: ubuntu-22.04
install:
- g++-11
sources:
- "ppa:ubuntu-toolchain-r/test"
- toolset: gcc-12
cxxstd: "03-gnu,11-gnu,14-gnu,17-gnu,20-gnu,23-gnu"
os: ubuntu-22.04
install:
- g++-12
- name: UBSAN
toolset: gcc-11
cxxstd: "03-gnu,11-gnu,14-gnu,17-gnu,20-gnu"
cxxstd: "03-gnu,11-gnu,14-gnu,17-gnu,20-gnu,23-gnu"
ubsan: 1
build_variant: debug
os: ubuntu-20.04
os: ubuntu-22.04
install:
- g++-11
sources:
- "ppa:ubuntu-toolchain-r/test"
# Linux, clang
- toolset: clang
compiler: clang++-3.5
cxxstd: "03,11"
os: ubuntu-20.04
cxxstd: "11"
os: ubuntu-latest
container: ubuntu:16.04
install:
- clang-3.5
- toolset: clang
compiler: clang++-3.6
cxxstd: "03,11,14"
os: ubuntu-20.04
cxxstd: "11,14"
os: ubuntu-latest
container: ubuntu:16.04
install:
- clang-3.6
- toolset: clang
compiler: clang++-3.7
cxxstd: "03,11,14"
os: ubuntu-20.04
cxxstd: "11,14"
os: ubuntu-latest
container: ubuntu:16.04
install:
- clang-3.7
- toolset: clang
compiler: clang++-3.8
cxxstd: "03,11,14"
os: ubuntu-20.04
cxxstd: "11,14"
os: ubuntu-latest
container: ubuntu:16.04
install:
- clang-3.8
- toolset: clang
compiler: clang++-3.9
cxxstd: "03,11,14"
os: ubuntu-18.04
cxxstd: "11,14"
os: ubuntu-latest
container: ubuntu:18.04
install:
- clang-3.9
- toolset: clang
compiler: clang++-4.0
cxxstd: "03,11,14"
os: ubuntu-18.04
cxxstd: "11,14"
os: ubuntu-latest
container: ubuntu:18.04
install:
- clang-4.0
- toolset: clang
compiler: clang++-5.0
cxxstd: "03,11,14,1z"
os: ubuntu-18.04
cxxstd: "11,14,1z"
os: ubuntu-latest
container: ubuntu:18.04
install:
- clang-5.0
- toolset: clang
compiler: clang++-6.0
cxxstd: "03,11,14,17"
os: ubuntu-18.04
cxxstd: "11,14,17"
os: ubuntu-latest
container: ubuntu:18.04
install:
- clang-6.0
- toolset: clang
compiler: clang++-7
cxxstd: "03,11,14,17"
os: ubuntu-18.04
cxxstd: "11,14,17"
os: ubuntu-latest
container: ubuntu:18.04
install:
- clang-7
# Note: clang-8 does not fully support C++20, so it is not compatible with libstdc++-8 in this mode
- toolset: clang
compiler: clang++-8
cxxstd: "03,11,14,17,2a"
os: ubuntu-18.04
cxxstd: "11,14,17,2a"
os: ubuntu-latest
container: ubuntu:18.04
install:
- clang-8
- g++-7
gcc_toolchain: 7
- toolset: clang
compiler: clang++-9
cxxstd: "03,11,14,17,2a"
cxxstd: "11,14,17,2a"
os: ubuntu-20.04
install:
- clang-9
- toolset: clang
compiler: clang++-10
cxxstd: "03,11,14,17,20"
cxxstd: "11,14,17,20"
os: ubuntu-20.04
install:
- clang-10
- toolset: clang
compiler: clang++-11
cxxstd: "03,11,14,17,20"
os: ubuntu-20.04
cxxstd: "11,14,17,20"
os: ubuntu-22.04
install:
- clang-11
- toolset: clang
compiler: clang++-12
cxxstd: "03-gnu,11-gnu,14-gnu,17-gnu,20-gnu"
os: ubuntu-20.04
cxxstd: "03-gnu,11-gnu,14-gnu,17-gnu,20-gnu,2b-gnu"
os: ubuntu-22.04
install:
- clang-12
- g++-11
gcc_toolchain: 11
- toolset: clang
compiler: clang++-12
cxxstd: "03-gnu,11-gnu,14-gnu,17-gnu,20-gnu"
os: ubuntu-20.04
compiler: clang++-13
cxxstd: "03-gnu,11-gnu,14-gnu,17-gnu,20-gnu,2b-gnu"
os: ubuntu-22.04
install:
- clang-12
- libc++-12-dev
- libc++abi-12-dev
- clang-13
- g++-11
gcc_toolchain: 11
- toolset: clang
compiler: clang++-14
cxxstd: "03-gnu,11-gnu,14-gnu,17-gnu,20-gnu,2b-gnu"
os: ubuntu-22.04
install:
- clang-14
- g++-11
gcc_toolchain: 11
- toolset: clang
compiler: clang++-15
cxxstd: "03-gnu,11-gnu,14-gnu,17-gnu,20-gnu,2b-gnu"
os: ubuntu-22.04
install:
- clang-15
- g++-11
gcc_toolchain: 11
- toolset: clang
compiler: clang++-15
cxxstd: "03-gnu,11-gnu,14-gnu,17-gnu,20-gnu,2b-gnu"
os: ubuntu-22.04
install:
- clang-15
- libc++-15-dev
- libc++abi-15-dev
cxxflags: -stdlib=libc++
linkflags: -stdlib=libc++
- toolset: clang
compiler: clang++-13
cxxstd: "03-gnu,11-gnu,14-gnu,17-gnu,20-gnu"
os: ubuntu-20.04
compiler: clang++-16
cxxstd: "03-gnu,11-gnu,14-gnu,17-gnu,20-gnu,2b-gnu"
os: ubuntu-22.04
install:
- clang-13
- clang-16
sources:
- "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-13 main"
- "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-16 main"
source_keys:
- "https://apt.llvm.org/llvm-snapshot.gpg.key"
- toolset: clang
compiler: clang++-13
cxxstd: "03-gnu,11-gnu,14-gnu,17-gnu,20-gnu"
os: ubuntu-20.04
compiler: clang++-16
cxxstd: "03-gnu,11-gnu,14-gnu,17-gnu,20-gnu,2b-gnu"
os: ubuntu-22.04
install:
- clang-13
- libc++-13-dev
- libc++abi-13-dev
- clang-16
- libc++-16-dev
- libc++abi-16-dev
sources:
- "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-13 main"
- "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-16 main"
source_keys:
- "https://apt.llvm.org/llvm-snapshot.gpg.key"
cxxflags: -stdlib=libc++
linkflags: -stdlib=libc++
- name: UBSAN
toolset: clang
compiler: clang++-12
cxxstd: "03-gnu,11-gnu,14-gnu,17-gnu,20-gnu"
compiler: clang++-15
cxxstd: "03-gnu,11-gnu,14-gnu,17-gnu,20-gnu,2b-gnu"
cxxflags: -stdlib=libc++
linkflags: -stdlib=libc++
ubsan: 1
build_variant: debug
os: ubuntu-20.04
os: ubuntu-22.04
install:
- clang-12
- libc++-12-dev
- libc++abi-12-dev
- clang-15
- libc++-15-dev
- libc++abi-15-dev
- toolset: clang
cxxstd: "03,11,14,17,2a"
os: macos-10.15
cxxstd: "11,14,17,2a"
os: macos-11
timeout-minutes: 60
runs-on: ${{matrix.os}}
@ -277,12 +306,18 @@ jobs:
if [ -f "/etc/debian_version" ]
then
apt-get -o Acquire::Retries=$NET_RETRY_COUNT update
apt-get -o Acquire::Retries=$NET_RETRY_COUNT install -y sudo software-properties-common tzdata wget curl apt-transport-https ca-certificates make build-essential g++ python python3 perl git cmake
if [ "$(apt-cache search "^python-is-python3$" | wc -l)" -ne 0 ]
then
PYTHON_PACKAGE="python-is-python3"
else
PYTHON_PACKAGE="python"
fi
apt-get -o Acquire::Retries=$NET_RETRY_COUNT install -y sudo software-properties-common tzdata wget curl apt-transport-https ca-certificates make build-essential g++ $PYTHON_PACKAGE python3 perl git cmake
fi
fi
git config --global pack.threads 0
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Install packages
if: matrix.install

View File

@ -14,9 +14,6 @@ branches:
environment:
matrix:
- TOOLSET: msvc-9.0,msvc-10.0,msvc-11.0,msvc-12.0
ADDRMD: 32
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
- TOOLSET: msvc-14.0
CXXSTD: 14,latest
ADDRMD: 32,64
@ -38,23 +35,23 @@ environment:
CXXSTD: 14,17,latest
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
- TOOLSET: gcc
CXXSTD: 03,11,14,1z
CXXSTD: 11,14,1z
ADDPATH: C:\cygwin\bin;
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
- TOOLSET: gcc
CXXSTD: 03,11,14,1z
CXXSTD: 11,14,1z
ADDPATH: C:\cygwin64\bin;
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
- TOOLSET: gcc
CXXSTD: 03,11,14,1z
CXXSTD: 11,14,1z
ADDPATH: C:\mingw\bin;
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
- TOOLSET: gcc
CXXSTD: 03,11,14,1z
CXXSTD: 11,14,1z
ADDPATH: C:\mingw-w64\x86_64-6.3.0-posix-seh-rt_v5-rev1\mingw64\bin;
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
- TOOLSET: gcc
CXXSTD: 03,11,14,1z
CXXSTD: 11,14,1z
ADDPATH: C:\mingw-w64\x86_64-7.3.0-posix-seh-rt_v5-rev0\mingw64\bin;
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015

View File

@ -9,7 +9,7 @@
#include <limits>
#include <stdexcept>
#include <boost/throw_exception.hpp>
#include <boost/core/swap.hpp>
#include <boost/core/invoke_swap.hpp>
#include <boost/core/enable_if.hpp>
namespace boost { namespace integer {
@ -38,7 +38,7 @@ extended_euclidean(Z m, Z n)
if (m < n)
{
swapped = true;
boost::swap(m, n);
boost::core::invoke_swap(m, n);
}
Z u0 = m;
Z u1 = 1;