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

Clang and EDG support for <coroutine> #1223

Closed
StephanTLavavej opened this issue Aug 22, 2020 · 1 comment · Fixed by #2861
Closed

Clang and EDG support for <coroutine> #1223

StephanTLavavej opened this issue Aug 22, 2020 · 1 comment · Fixed by #2861
Labels
fixed Something works now, yay! test Related to test code

Comments

@StephanTLavavej
Copy link
Member

We've arranged for the <coroutine> header and its test coverage to activate when a compiler defines __cpp_impl_coroutine to 201902L (the C++20 value). This is expected for MSVC in VS 2019 16.8 Preview 4 and we've verified that the test will pass at that time.

Currently, this is inactive for Clang and EDG. In theory, we should be able to take no action whatsoever, and this will automatically work in the future - but we should probably coordinate with their compiler devs to verify that everything will work with no library changes needed.

STL/stl/inc/yvals_core.h

Lines 1171 to 1177 in 484fbc9

#ifdef __cpp_impl_coroutine // TRANSITION, Clang and EDG coroutine support
#if __cpp_impl_coroutine >= 201902L
#define __cpp_lib_coroutine 201902L
#else // ^^^ __cpp_impl_coroutine >= 201902L ^^^ / vvv __cpp_impl_coroutine < 201902L vvv
#define __cpp_lib_coroutine 197000L // TRANSITION, VS 2019 16.8 Preview 4
#endif // ^^^ __cpp_impl_coroutine < 201902L ^^^
#endif // __cpp_impl_coroutine

STL/stl/inc/coroutine

Lines 16 to 18 in 484fbc9

#ifndef __cpp_lib_coroutine
#pragma message("The contents of <coroutine> are available only with C++20 or later.")
#else // ^^^ __cpp_lib_coroutine not defined / __cpp_lib_coroutine defined vvv

#include <version> // TRANSITION, P0912R5 Library Support For Coroutines
#if defined(__cpp_lib_coroutine) && __cpp_lib_coroutine >= 201902L // TRANSITION, P0912R5 Library Support For Coroutines

@CaseyCarter
Copy link
Member

CaseyCarter commented Jan 19, 2022

My investigation with LLVM trunk suggests that <coroutine> will "light up" in Clang when LLVM 14 releases with no changes required.

Also, I'm not sure exactly when it happened, but EDG does now support <coroutine> and we have enabled test coverage.

@CaseyCarter CaseyCarter added blocked on Clang 14 and removed compiler Compiler work involved labels Jan 19, 2022
@StephanTLavavej StephanTLavavej added compiler Compiler work involved test Related to test code and removed blocked on Clang 14 compiler Compiler work involved labels Jul 13, 2022
@StephanTLavavej StephanTLavavej added the fixed Something works now, yay! label Jul 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fixed Something works now, yay! test Related to test code
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants