From ecf65330c11544ebf35e198087b4a42be089c620 Mon Sep 17 00:00:00 2001 From: Jonathan Wakely Date: Tue, 17 Nov 2020 15:26:29 +0000 Subject: [PATCH] libstdc++: Fix unconditional definition of __cpp_lib_span in [PR 97869} The header is empty unless Concepts are supported, but defines the __cpp_lib_span feature test macro unconditionally. It should be guarded by the same conditions as in . libstdc++-v3/ChangeLog: PR libstdc++/97869 * include/precompiled/stdc++.h: Include . * include/std/version (__cpp_lib_span): Check __cpp_lib_concepts before defining. --- libstdc++-v3/include/precompiled/stdc++.h | 3 +++ libstdc++-v3/include/std/version | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/libstdc++-v3/include/precompiled/stdc++.h b/libstdc++-v3/include/precompiled/stdc++.h index 8899c323a28..a418c46288d 100644 --- a/libstdc++-v3/include/precompiled/stdc++.h +++ b/libstdc++-v3/include/precompiled/stdc++.h @@ -137,6 +137,9 @@ #include #include #include +#if __cpp_impl_coroutine +# include +#endif #include #include #include diff --git a/libstdc++-v3/include/std/version b/libstdc++-v3/include/std/version index 7f51ef3a6c4..12455ad9314 100644 --- a/libstdc++-v3/include/std/version +++ b/libstdc++-v3/include/std/version @@ -226,7 +226,9 @@ # define __cpp_lib_ranges 201911L #endif #define __cpp_lib_shift 201806L -#define __cpp_lib_span 202002L +#if __cpp_lib_concepts +# define __cpp_lib_span 202002L +#endif #define __cpp_lib_ssize 201902L #define __cpp_lib_starts_ends_with 201711L # if _GLIBCXX_USE_CXX11_ABI -- 2.30.2