Skip to content

Commit 9601c7f

Browse files
committed
Add Clang 13 and Clang 14 to CI (#47)
1 parent a0baddd commit 9601c7f

File tree

3 files changed

+70
-1
lines changed

3 files changed

+70
-1
lines changed

.github/workflows/cmake.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,38 @@ jobs:
7979
exe_linker_flags: -lc++,
8080
cxxver: 20,
8181
}
82+
- {
83+
name: "Linux clang-13 C++17",
84+
os: ubuntu-20.04,
85+
cxx: "clang++-13",
86+
cxx_flags: -stdlib=libc++,
87+
exe_linker_flags: -lc++,
88+
cxxver: 17,
89+
}
90+
- {
91+
name: "Linux clang-13 C++20",
92+
os: ubuntu-20.04,
93+
cxx: "clang++-13",
94+
cxx_flags: -stdlib=libc++,
95+
exe_linker_flags: -lc++,
96+
cxxver: 20,
97+
}
98+
- {
99+
name: "Linux clang-14 C++17",
100+
os: ubuntu-20.04,
101+
cxx: "clang++-14",
102+
cxx_flags: -stdlib=libc++,
103+
exe_linker_flags: -lc++,
104+
cxxver: 17,
105+
}
106+
- {
107+
name: "Linux clang-14 C++20",
108+
os: ubuntu-20.04,
109+
cxx: "clang++-14",
110+
cxx_flags: -stdlib=libc++,
111+
exe_linker_flags: -lc++,
112+
cxxver: 20,
113+
}
82114
- {
83115
name: "Windows MSVC 2017 (x64) C++17",
84116
os: windows-2016,
@@ -144,6 +176,28 @@ jobs:
144176
sudo ./llvm.sh 12
145177
sudo apt-get install libc++-12-dev libc++abi-12-dev libunwind-12-dev
146178
179+
- name: Install Clang 13
180+
id: install_clang_13
181+
if: startsWith(matrix.config.os, 'ubuntu') && ( matrix.config.cxx == 'clang++-13' )
182+
shell: bash
183+
working-directory: ${{ env.HOME }}
184+
run: |
185+
wget https://apt.llvm.org/llvm.sh
186+
chmod +x llvm.sh
187+
sudo ./llvm.sh 13
188+
sudo apt-get install libc++-13-dev libc++abi-13-dev libunwind-13-dev
189+
190+
- name: Install Clang 14
191+
id: install_clang_14
192+
if: startsWith(matrix.config.os, 'ubuntu') && ( matrix.config.cxx == 'clang++-14' )
193+
shell: bash
194+
working-directory: ${{ env.HOME }}
195+
run: |
196+
wget https://apt.llvm.org/llvm.sh
197+
chmod +x llvm.sh
198+
sudo ./llvm.sh 14
199+
sudo apt-get install libc++-14-dev libc++abi-14-dev libunwind-14-dev
200+
147201
- name: Install g++ 10
148202
id: install_gcc_10
149203
if: startsWith(matrix.config.os, 'ubuntu') && ( matrix.config.cxx == 'g++-10' )

include/cppcoro/config.hpp

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,21 @@
156156
#ifdef __cpp_lib_coroutine
157157
#define CPPCORO_COROHEADER_FOUND_AND_USABLE
158158
#endif
159-
#endif
159+
#endif
160+
#elif CPPCORO_COMPILER_CLANG
161+
# if __clang_major__ >= 14
162+
// clang 14 in c++-17 mode has a non-usable coroutine header
163+
#if __has_include(<coroutine>)
164+
#include <coroutine>
165+
#ifdef __cpp_lib_coroutine
166+
#define CPPCORO_COROHEADER_FOUND_AND_USABLE
167+
#endif
168+
#endif
169+
# else
170+
#if __has_include(<coroutine>)
171+
#define CPPCORO_COROHEADER_FOUND_AND_USABLE
172+
#endif
173+
# endif
160174
#else
161175
#if __has_include(<coroutine>)
162176
#define CPPCORO_COROHEADER_FOUND_AND_USABLE

include/cppcoro/task.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#include <type_traits>
1818
#include <cstdint>
1919
#include <cassert>
20+
#include <new>
2021

2122
#include <cppcoro/coroutine.hpp>
2223

0 commit comments

Comments
 (0)