From 5ecaaf98dc6678fab9607822ec083830c536eb68 Mon Sep 17 00:00:00 2001 From: Jonathan Wakely Date: Tue, 19 Nov 2019 09:34:59 +0000 Subject: [PATCH] libstdc++: Fix declarations of variable templates This code is invalid and rejected by other compilers (see PR 92576). * include/bits/regex.h (ranges::__detail::__enable_view_impl): Fix declaration. * include/bits/stl_multiset.h (ranges::__detail::__enable_view_impl): Likewise. * include/bits/stl_set.h (ranges::__detail::__enable_view_impl): Likewise. * include/bits/unordered_set.h (ranges::__detail::__enable_view_impl): Likewise. * include/debug/multiset.h (ranges::__detail::__enable_view_impl): Likewise. * include/debug/set.h (ranges::__detail::__enable_view_impl): Likewise. * include/debug/unordered_set (ranges::__detail::__enable_view_impl): Likewise. From-SVN: r278440 --- libstdc++-v3/ChangeLog | 16 ++++++++++++++++ libstdc++-v3/include/bits/regex.h | 2 +- libstdc++-v3/include/bits/stl_multiset.h | 2 +- libstdc++-v3/include/bits/stl_set.h | 2 +- libstdc++-v3/include/bits/unordered_set.h | 2 +- libstdc++-v3/include/debug/multiset.h | 2 +- libstdc++-v3/include/debug/set.h | 2 +- libstdc++-v3/include/debug/unordered_set | 2 +- 8 files changed, 23 insertions(+), 7 deletions(-) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 6f493120ef4..a8fbd3a7509 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,19 @@ +2019-11-19 Jonathan Wakely + + * include/bits/regex.h (ranges::__detail::__enable_view_impl): Fix + declaration. + * include/bits/stl_multiset.h (ranges::__detail::__enable_view_impl): + Likewise. + * include/bits/stl_set.h (ranges::__detail::__enable_view_impl): + Likewise. + * include/bits/unordered_set.h (ranges::__detail::__enable_view_impl): + Likewise. + * include/debug/multiset.h (ranges::__detail::__enable_view_impl): + Likewise. + * include/debug/set.h (ranges::__detail::__enable_view_impl): Likewise. + * include/debug/unordered_set (ranges::__detail::__enable_view_impl): + Likewise. + 2019-11-18 Jonathan Wakely * include/std/thread: Reduce header dependencies. diff --git a/libstdc++-v3/include/bits/regex.h b/libstdc++-v3/include/bits/regex.h index 49994369563..4a19065fb58 100644 --- a/libstdc++-v3/include/bits/regex.h +++ b/libstdc++-v3/include/bits/regex.h @@ -2061,7 +2061,7 @@ _GLIBCXX_END_NAMESPACE_CXX11 #if __cplusplus > 201703L namespace ranges::__detail { - template inline constexpr bool __enable_view_impl; + template extern inline const bool __enable_view_impl; template inline constexpr bool __enable_view_impl> = false; diff --git a/libstdc++-v3/include/bits/stl_multiset.h b/libstdc++-v3/include/bits/stl_multiset.h index 9e34961f4a5..14207e62205 100644 --- a/libstdc++-v3/include/bits/stl_multiset.h +++ b/libstdc++-v3/include/bits/stl_multiset.h @@ -1042,7 +1042,7 @@ _GLIBCXX_END_NAMESPACE_CONTAINER #if __cplusplus > 201703L namespace ranges::__detail { - template inline constexpr bool __enable_view_impl; + template extern inline const bool __enable_view_impl; template inline constexpr bool __enable_view_impl<_GLIBCXX_STD_C::multiset<_Key, _Compare, _Alloc>> diff --git a/libstdc++-v3/include/bits/stl_set.h b/libstdc++-v3/include/bits/stl_set.h index 135d57af496..85f26c24dae 100644 --- a/libstdc++-v3/include/bits/stl_set.h +++ b/libstdc++-v3/include/bits/stl_set.h @@ -1054,7 +1054,7 @@ _GLIBCXX_END_NAMESPACE_CONTAINER #if __cplusplus > 201703L namespace ranges::__detail { - template inline constexpr bool __enable_view_impl; + template extern inline const bool __enable_view_impl; template inline constexpr bool __enable_view_impl<_GLIBCXX_STD_C::set<_Key, _Compare, _Alloc>> = false; diff --git a/libstdc++-v3/include/bits/unordered_set.h b/libstdc++-v3/include/bits/unordered_set.h index 98943fb1a47..b138d02bbe8 100644 --- a/libstdc++-v3/include/bits/unordered_set.h +++ b/libstdc++-v3/include/bits/unordered_set.h @@ -1775,7 +1775,7 @@ _GLIBCXX_END_NAMESPACE_CONTAINER #if __cplusplus > 201703L namespace ranges::__detail { - template inline constexpr bool __enable_view_impl; + template extern inline const bool __enable_view_impl; template inline constexpr bool __enable_view_impl<_GLIBCXX_STD_C::unordered_set<_Val, _Hash, _Eq, diff --git a/libstdc++-v3/include/debug/multiset.h b/libstdc++-v3/include/debug/multiset.h index 00c5bcc0f24..62c7672dfb6 100644 --- a/libstdc++-v3/include/debug/multiset.h +++ b/libstdc++-v3/include/debug/multiset.h @@ -635,7 +635,7 @@ namespace __debug _GLIBCXX_BEGIN_NAMESPACE_VERSION namespace ranges::__detail { - template inline constexpr bool __enable_view_impl; + template extern inline const bool __enable_view_impl; template inline constexpr bool __enable_view_impl> diff --git a/libstdc++-v3/include/debug/set.h b/libstdc++-v3/include/debug/set.h index 16eee2947c9..8d0852a6af8 100644 --- a/libstdc++-v3/include/debug/set.h +++ b/libstdc++-v3/include/debug/set.h @@ -646,7 +646,7 @@ namespace __debug _GLIBCXX_BEGIN_NAMESPACE_VERSION namespace ranges::__detail { - template inline constexpr bool __enable_view_impl; + template extern inline const bool __enable_view_impl; template inline constexpr bool __enable_view_impl> = false; diff --git a/libstdc++-v3/include/debug/unordered_set b/libstdc++-v3/include/debug/unordered_set index 5dbb754a100..4b814cb20e0 100644 --- a/libstdc++-v3/include/debug/unordered_set +++ b/libstdc++-v3/include/debug/unordered_set @@ -1187,7 +1187,7 @@ namespace __debug _GLIBCXX_BEGIN_NAMESPACE_VERSION namespace ranges::__detail { - template inline constexpr bool __enable_view_impl; + template extern inline const bool __enable_view_impl; template inline constexpr bool __enable_view_impl> -- 2.30.2