mirror of
https://github.com/fmtlib/fmt.git
synced 2025-07-29 18:27:40 +02:00
Add clang-3.4
This commit is contained in:
71
.github/workflows/linux.yml
vendored
71
.github/workflows/linux.yml
vendored
@ -10,12 +10,13 @@ jobs:
|
|||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
cxx: [g++-4.9, g++-11, clang++-11]
|
cxx: [g++-4.9, g++-11, clang++-3.6, clang++-11]
|
||||||
build_type: [Debug, Release]
|
build_type: [Debug, Release]
|
||||||
std: [11]
|
std: [11]
|
||||||
shared: [""]
|
shared: [""]
|
||||||
include:
|
include:
|
||||||
- cxx: g++-4.9
|
- cxx: g++-4.9
|
||||||
|
- cxx: clang++-3.6
|
||||||
- cxx: g++-11
|
- cxx: g++-11
|
||||||
build_type: Debug
|
build_type: Debug
|
||||||
std: 14
|
std: 14
|
||||||
@ -66,29 +67,65 @@ jobs:
|
|||||||
# https://launchpad.net/ubuntu/xenial/amd64/g++-4.9/4.9.3-13ubuntu2
|
# https://launchpad.net/ubuntu/xenial/amd64/g++-4.9/4.9.3-13ubuntu2
|
||||||
wget --no-verbose \
|
wget --no-verbose \
|
||||||
http://launchpadlibrarian.net/230069137/libmpfr4_3.1.3-2_amd64.deb \
|
http://launchpadlibrarian.net/230069137/libmpfr4_3.1.3-2_amd64.deb \
|
||||||
http://launchpadlibrarian.net/253728314/gcc-4.9-base_4.9.3-13ubuntu2_amd64.deb \
|
|
||||||
http://launchpadlibrarian.net/445345919/gcc-5-base_5.4.0-6ubuntu1~16.04.12_amd64.deb \
|
|
||||||
http://launchpadlibrarian.net/253728399/cpp-4.9_4.9.3-13ubuntu2_amd64.deb \
|
|
||||||
http://launchpadlibrarian.net/253728424/libasan1_4.9.3-13ubuntu2_amd64.deb \
|
http://launchpadlibrarian.net/253728424/libasan1_4.9.3-13ubuntu2_amd64.deb \
|
||||||
http://launchpadlibrarian.net/445346135/libubsan0_5.4.0-6ubuntu1~16.04.12_amd64.deb \
|
http://launchpadlibrarian.net/445346135/libubsan0_5.4.0-6ubuntu1~16.04.12_amd64.deb \
|
||||||
http://launchpadlibrarian.net/445346112/libcilkrts5_5.4.0-6ubuntu1~16.04.12_amd64.deb \
|
http://launchpadlibrarian.net/445346112/libcilkrts5_5.4.0-6ubuntu1~16.04.12_amd64.deb \
|
||||||
http://launchpadlibrarian.net/253728426/libgcc-4.9-dev_4.9.3-13ubuntu2_amd64.deb \
|
http://launchpadlibrarian.net/253728426/libgcc-4.9-dev_4.9.3-13ubuntu2_amd64.deb \
|
||||||
http://launchpadlibrarian.net/253728404/gcc-4.9_4.9.3-13ubuntu2_amd64.deb \
|
|
||||||
http://launchpadlibrarian.net/253728432/libstdc++-4.9-dev_4.9.3-13ubuntu2_amd64.deb \
|
http://launchpadlibrarian.net/253728432/libstdc++-4.9-dev_4.9.3-13ubuntu2_amd64.deb \
|
||||||
|
http://launchpadlibrarian.net/253728314/gcc-4.9-base_4.9.3-13ubuntu2_amd64.deb \
|
||||||
|
http://launchpadlibrarian.net/445345919/gcc-5-base_5.4.0-6ubuntu1~16.04.12_amd64.deb \
|
||||||
|
http://launchpadlibrarian.net/253728399/cpp-4.9_4.9.3-13ubuntu2_amd64.deb \
|
||||||
|
http://launchpadlibrarian.net/253728404/gcc-4.9_4.9.3-13ubuntu2_amd64.deb \
|
||||||
http://launchpadlibrarian.net/253728401/g++-4.9_4.9.3-13ubuntu2_amd64.deb
|
http://launchpadlibrarian.net/253728401/g++-4.9_4.9.3-13ubuntu2_amd64.deb
|
||||||
sudo dpkg -i libmpfr4_3.1.3-2_amd64.deb \
|
sudo dpkg -i \
|
||||||
gcc-4.9-base_4.9.3-13ubuntu2_amd64.deb \
|
libmpfr4_3.1.3-2_amd64.deb \
|
||||||
gcc-5-base_5.4.0-6ubuntu1~16.04.12_amd64.deb \
|
|
||||||
cpp-4.9_4.9.3-13ubuntu2_amd64.deb \
|
|
||||||
libasan1_4.9.3-13ubuntu2_amd64.deb \
|
libasan1_4.9.3-13ubuntu2_amd64.deb \
|
||||||
libubsan0_5.4.0-6ubuntu1~16.04.12_amd64.deb \
|
libubsan0_5.4.0-6ubuntu1~16.04.12_amd64.deb \
|
||||||
libcilkrts5_5.4.0-6ubuntu1~16.04.12_amd64.deb \
|
libcilkrts5_5.4.0-6ubuntu1~16.04.12_amd64.deb \
|
||||||
libgcc-4.9-dev_4.9.3-13ubuntu2_amd64.deb \
|
libgcc-4.9-dev_4.9.3-13ubuntu2_amd64.deb \
|
||||||
gcc-4.9_4.9.3-13ubuntu2_amd64.deb \
|
|
||||||
libstdc++-4.9-dev_4.9.3-13ubuntu2_amd64.deb \
|
libstdc++-4.9-dev_4.9.3-13ubuntu2_amd64.deb \
|
||||||
|
gcc-4.9-base_4.9.3-13ubuntu2_amd64.deb \
|
||||||
|
gcc-5-base_5.4.0-6ubuntu1~16.04.12_amd64.deb \
|
||||||
|
cpp-4.9_4.9.3-13ubuntu2_amd64.deb \
|
||||||
|
gcc-4.9_4.9.3-13ubuntu2_amd64.deb \
|
||||||
g++-4.9_4.9.3-13ubuntu2_amd64.deb
|
g++-4.9_4.9.3-13ubuntu2_amd64.deb
|
||||||
if: ${{ matrix.cxx == 'g++-4.9' }}
|
if: ${{ matrix.cxx == 'g++-4.9' }}
|
||||||
|
|
||||||
|
- name: Install Clang 3.6
|
||||||
|
run: |
|
||||||
|
sudo apt update
|
||||||
|
sudo apt install libtinfo5 libobjc4
|
||||||
|
# https://code.launchpad.net/ubuntu/xenial/amd64/clang-3.6/1:3.6.2-3ubuntu2
|
||||||
|
wget --no-verbose \
|
||||||
|
http://launchpadlibrarian.net/230019046/libffi6_3.2.1-4_amd64.deb \
|
||||||
|
http://launchpadlibrarian.net/445346109/libasan2_5.4.0-6ubuntu1~16.04.12_amd64.deb \
|
||||||
|
http://launchpadlibrarian.net/445346135/libubsan0_5.4.0-6ubuntu1~16.04.12_amd64.deb \
|
||||||
|
http://launchpadlibrarian.net/445346112/libcilkrts5_5.4.0-6ubuntu1~16.04.12_amd64.deb \
|
||||||
|
http://launchpadlibrarian.net/445346128/libmpx0_5.4.0-6ubuntu1~16.04.12_amd64.deb \
|
||||||
|
http://launchpadlibrarian.net/445346113/libgcc-5-dev_5.4.0-6ubuntu1~16.04.12_amd64.deb \
|
||||||
|
http://launchpadlibrarian.net/445346131/libstdc++-5-dev_5.4.0-6ubuntu1~16.04.12_amd64.deb \
|
||||||
|
http://launchpadlibrarian.net/445346022/libobjc-5-dev_5.4.0-6ubuntu1~16.04.12_amd64.deb \
|
||||||
|
http://launchpadlibrarian.net/254405108/libllvm3.6v5_3.6.2-3ubuntu2_amd64.deb \
|
||||||
|
http://launchpadlibrarian.net/254405097/libclang-common-3.6-dev_3.6.2-3ubuntu2_amd64.deb \
|
||||||
|
http://launchpadlibrarian.net/254405101/libclang1-3.6_3.6.2-3ubuntu2_amd64.deb \
|
||||||
|
http://launchpadlibrarian.net/445345919/gcc-5-base_5.4.0-6ubuntu1~16.04.12_amd64.deb \
|
||||||
|
http://launchpadlibrarian.net/254405091/clang-3.6_3.6.2-3ubuntu2_amd64.deb
|
||||||
|
sudo dpkg -i \
|
||||||
|
libffi6_3.2.1-4_amd64.deb \
|
||||||
|
libasan2_5.4.0-6ubuntu1~16.04.12_amd64.deb \
|
||||||
|
libubsan0_5.4.0-6ubuntu1~16.04.12_amd64.deb \
|
||||||
|
libcilkrts5_5.4.0-6ubuntu1~16.04.12_amd64.deb \
|
||||||
|
libmpx0_5.4.0-6ubuntu1~16.04.12_amd64.deb \
|
||||||
|
libgcc-5-dev_5.4.0-6ubuntu1~16.04.12_amd64.deb \
|
||||||
|
libstdc++-5-dev_5.4.0-6ubuntu1~16.04.12_amd64.deb \
|
||||||
|
libobjc-5-dev_5.4.0-6ubuntu1~16.04.12_amd64.deb \
|
||||||
|
libllvm3.6v5_3.6.2-3ubuntu2_amd64.deb \
|
||||||
|
libclang-common-3.6-dev_3.6.2-3ubuntu2_amd64.deb \
|
||||||
|
libclang1-3.6_3.6.2-3ubuntu2_amd64.deb \
|
||||||
|
gcc-5-base_5.4.0-6ubuntu1~16.04.12_amd64.deb \
|
||||||
|
clang-3.6_3.6.2-3ubuntu2_amd64.deb
|
||||||
|
if: ${{ matrix.cxx == 'clang++-3.6' }}
|
||||||
|
|
||||||
- name: Add repositories for newer GCC
|
- name: Add repositories for newer GCC
|
||||||
run: |
|
run: |
|
||||||
sudo apt-add-repository ppa:ubuntu-toolchain-r/test
|
sudo apt-add-repository ppa:ubuntu-toolchain-r/test
|
||||||
@ -102,9 +139,9 @@ jobs:
|
|||||||
curl http://mirrors.ubuntu.com/mirrors.txt | sudo tee --append /etc/apt/mirrors.txt
|
curl http://mirrors.ubuntu.com/mirrors.txt | sudo tee --append /etc/apt/mirrors.txt
|
||||||
sudo sed -i 's~http://azure.archive.ubuntu.com/ubuntu/~mirror+file:/etc/apt/mirrors.txt~' /etc/apt/sources.list
|
sudo sed -i 's~http://azure.archive.ubuntu.com/ubuntu/~mirror+file:/etc/apt/mirrors.txt~' /etc/apt/sources.list
|
||||||
|
|
||||||
- name: Create Build Environment
|
- name: Create build environment
|
||||||
run: |
|
run: |
|
||||||
sudo apt update --allow-unauthenticated
|
sudo apt update
|
||||||
${{matrix.install}}
|
${{matrix.install}}
|
||||||
sudo apt install locales-all
|
sudo apt install locales-all
|
||||||
cmake -E make_directory ${{runner.workspace}}/build
|
cmake -E make_directory ${{runner.workspace}}/build
|
||||||
@ -115,10 +152,12 @@ jobs:
|
|||||||
CXX: ${{matrix.cxx}}
|
CXX: ${{matrix.cxx}}
|
||||||
CXXFLAGS: ${{matrix.cxxflags}}
|
CXXFLAGS: ${{matrix.cxxflags}}
|
||||||
run: |
|
run: |
|
||||||
cmake -DCMAKE_BUILD_TYPE=${{matrix.build_type}} ${{matrix.fuzz}} ${{matrix.shared}} \
|
cmake -DCMAKE_BUILD_TYPE=${{matrix.build_type}} \
|
||||||
-DCMAKE_CXX_STANDARD=${{matrix.std}} -DFMT_DOC=OFF \
|
-DCMAKE_CXX_STANDARD=${{matrix.std}} \
|
||||||
-DCMAKE_CXX_VISIBILITY_PRESET=hidden -DCMAKE_VISIBILITY_INLINES_HIDDEN=ON \
|
-DCMAKE_CXX_VISIBILITY_PRESET=hidden \
|
||||||
-DFMT_PEDANTIC=ON -DFMT_WERROR=ON $GITHUB_WORKSPACE
|
-DCMAKE_VISIBILITY_INLINES_HIDDEN=ON \
|
||||||
|
-DFMT_DOC=OFF -DFMT_PEDANTIC=ON -DFMT_WERROR=ON \
|
||||||
|
${{matrix.fuzz}} ${{matrix.shared}} $GITHUB_WORKSPACE
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
working-directory: ${{runner.workspace}}/build
|
working-directory: ${{runner.workspace}}/build
|
||||||
|
@ -122,7 +122,7 @@ hide:
|
|||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
The library is highly portable and requires only a minimal <b>subset of
|
The library is highly portable and requires only a minimal <b>subset of
|
||||||
C++11</b> features which are available in GCC 4.9, Clang 3.4, MSVC 19.10
|
C++11</b> features which are available in GCC 4.9, Clang 3.6, MSVC 19.10
|
||||||
(2017) and later. Newer compiler and standard library features are used
|
(2017) and later. Newer compiler and standard library features are used
|
||||||
if available, and enable additional functionality.
|
if available, and enable additional functionality.
|
||||||
</p>
|
</p>
|
||||||
|
@ -705,7 +705,7 @@ using is_integer =
|
|||||||
|
|
||||||
#if defined(FMT_USE_FLOAT128)
|
#if defined(FMT_USE_FLOAT128)
|
||||||
// Use the provided definition.
|
// Use the provided definition.
|
||||||
#elif FMT_CLANG_VERSION && FMT_HAS_INCLUDE(<quadmath.h>)
|
#elif FMT_CLANG_VERSION >= 309 && FMT_HAS_INCLUDE(<quadmath.h>)
|
||||||
# define FMT_USE_FLOAT128 1
|
# define FMT_USE_FLOAT128 1
|
||||||
#elif FMT_GCC_VERSION && defined(_GLIBCXX_USE_FLOAT128) && \
|
#elif FMT_GCC_VERSION && defined(_GLIBCXX_USE_FLOAT128) && \
|
||||||
!defined(__STRICT_ANSI__)
|
!defined(__STRICT_ANSI__)
|
||||||
|
@ -774,13 +774,13 @@ struct formatter<
|
|||||||
: formatter<detail::all<typename T::container_type>, Char> {
|
: formatter<detail::all<typename T::container_type>, Char> {
|
||||||
using all = detail::all<typename T::container_type>;
|
using all = detail::all<typename T::container_type>;
|
||||||
template <typename FormatContext>
|
template <typename FormatContext>
|
||||||
auto format(const T& t, FormatContext& ctx) const -> decltype(ctx.out()) {
|
auto format(const T& value, FormatContext& ctx) const -> decltype(ctx.out()) {
|
||||||
struct getter : T {
|
struct getter : T {
|
||||||
static auto get(const T& t) -> all {
|
static auto get(const T& v) -> all {
|
||||||
return {t.*(&getter::c)}; // Access c through the derived class.
|
return {v.*(&getter::c)}; // Access c through the derived class.
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
return formatter<all>::format(getter::get(t), ctx);
|
return formatter<all>::format(getter::get(value), ctx);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -232,9 +232,12 @@ auto get(const tuple_like& t) noexcept -> decltype(t.get<N>()) {
|
|||||||
return t.get<N>();
|
return t.get<N>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// https://github.com/llvm/llvm-project/issues/39218
|
||||||
|
FMT_PRAGMA_CLANG(diagnostic ignored "-Wmismatched-tags")
|
||||||
|
|
||||||
namespace std {
|
namespace std {
|
||||||
template <>
|
template <>
|
||||||
struct tuple_size<tuple_like> : std::integral_constant<size_t, 2> {};
|
struct tuple_size<tuple_like> : public std::integral_constant<size_t, 2> {};
|
||||||
|
|
||||||
template <size_t N> struct tuple_element<N, tuple_like> {
|
template <size_t N> struct tuple_element<N, tuple_like> {
|
||||||
using type = decltype(std::declval<tuple_like>().get<N>());
|
using type = decltype(std::declval<tuple_like>().get<N>());
|
||||||
|
Reference in New Issue
Block a user