@@ -25,15 +25,19 @@ _STL_DISABLE_CLANG_WARNINGS
2525#pragma push_macro("new")
2626#undef new
2727
28- #if defined(__clang__) && !defined(_SILENCE_CLANG_COROUTINE_MESSAGE)
29- #error The <experimental/coroutine>, <experimental/generator>, and <experimental/resumable> \
30- headers do not support Clang, but the C++20 <coroutine> header does.
31- #endif // defined(__clang__) && !defined(_SILENCE_CLANG_COROUTINE_MESSAGE)
32- 
33- #ifdef __cpp_impl_coroutine
34- #error The <experimental/coroutine> and <experimental/resumable> headers are only supported with \
35- /await and implement pre-C++20 coroutine support. Use <coroutine> for standard C++20 coroutines.
36- #endif // defined(__cpp_impl_coroutine)
28+ #ifdef __clang__
29+ _EMIT_STL_ERROR(STL1009, "The <experimental/coroutine>, <experimental/generator>, and <experimental/resumable> "
30+                          "headers do not support Clang, but the C++20 <coroutine> and C++23 <generator> headers do.");
31+ #elif defined(__cpp_impl_coroutine)
32+ _EMIT_STL_ERROR(STL1010, "You're compiling with support for standard C++20 coroutines "
33+                          "(also available with /await:strict in C++14/17), so you should include <coroutine> "
34+                          "instead of <experimental/coroutine> and <experimental/resumable>.");
35+ #elif !defined(_SILENCE_EXPERIMENTAL_COROUTINE_DEPRECATION_WARNINGS)
36+ _EMIT_STL_ERROR(STL1011, "The /await compiler option, <experimental/coroutine>, <experimental/generator>, and "
37+                          "<experimental/resumable> are deprecated by Microsoft and will be REMOVED SOON. "
38+                          "They are superseded by the C++20 <coroutine> and C++23 <generator> headers. You can define "
39+                          "_SILENCE_EXPERIMENTAL_COROUTINE_DEPRECATION_WARNINGS to suppress this error for now.");
40+ #endif // _SILENCE_EXPERIMENTAL_COROUTINE_DEPRECATION_WARNINGS
3741
3842// intrinsics used in implementation of coroutine_handle
3943extern "C" size_t _coro_resume(void*) noexcept;
0 commit comments