Skip to content

Clang and EDG support for <coroutine> #1223

Description

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    fixedSomething works now, yay!testRelated to test code

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions