libstdc++: Fix declarations of variable templates
authorJonathan Wakely <jwakely@redhat.com>
Tue, 19 Nov 2019 09:34:59 +0000 (09:34 +0000)
committerJonathan Wakely <redi@gcc.gnu.org>
Tue, 19 Nov 2019 09:34:59 +0000 (09:34 +0000)
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
libstdc++-v3/include/bits/regex.h
libstdc++-v3/include/bits/stl_multiset.h
libstdc++-v3/include/bits/stl_set.h
libstdc++-v3/include/bits/unordered_set.h
libstdc++-v3/include/debug/multiset.h
libstdc++-v3/include/debug/set.h
libstdc++-v3/include/debug/unordered_set

index 6f493120ef4f4622d72467fd18c03df5ecfd4424..a8fbd3a75092d9085329106f2e36cb2d8e3c42ca 100644 (file)
@@ -1,3 +1,19 @@
+2019-11-19  Jonathan Wakely  <jwakely@redhat.com>
+
+       * 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  <jwakely@redhat.com>
 
        * include/std/thread: Reduce header dependencies.
index 49994369563986d1bb6a34b97cdb49c88bf40660..4a19065fb58cac243d7a3547b7b9a4873d861822 100644 (file)
@@ -2061,7 +2061,7 @@ _GLIBCXX_END_NAMESPACE_CXX11
 #if __cplusplus > 201703L
 namespace ranges::__detail
 {
-  template<typename _Tp> inline constexpr bool __enable_view_impl;
+  template<typename _Tp> extern inline const bool __enable_view_impl;
   template<typename _Bi_iter, typename _Alloc>
     inline constexpr bool __enable_view_impl<match_results<_Bi_iter, _Alloc>>
       = false;
index 9e34961f4a56375e85208b1ec2888c7922c20a19..14207e6220554fd6d23da562c8ea38db6ae57d5e 100644 (file)
@@ -1042,7 +1042,7 @@ _GLIBCXX_END_NAMESPACE_CONTAINER
 #if __cplusplus > 201703L
 namespace ranges::__detail
 {
-  template<typename _Tp> inline constexpr bool __enable_view_impl;
+  template<typename _Tp> extern inline const bool __enable_view_impl;
   template<typename _Key, typename _Compare, typename _Alloc>
     inline constexpr bool
       __enable_view_impl<_GLIBCXX_STD_C::multiset<_Key, _Compare, _Alloc>>
index 135d57af4961d811063db75f8db43908125ab6ef..85f26c24dae7f6fd0ac3cd4d6eb3a7ce0cd6c1eb 100644 (file)
@@ -1054,7 +1054,7 @@ _GLIBCXX_END_NAMESPACE_CONTAINER
 #if __cplusplus > 201703L
 namespace ranges::__detail
 {
-  template<typename _Tp> inline constexpr bool __enable_view_impl;
+  template<typename _Tp> extern inline const bool __enable_view_impl;
   template<typename _Key, typename _Compare, typename _Alloc>
     inline constexpr bool
       __enable_view_impl<_GLIBCXX_STD_C::set<_Key, _Compare, _Alloc>> = false;
index 98943fb1a47c6992d8c8f17ac24e0624f8649c69..b138d02bbe8112fb6434a99243c7770f0a097736 100644 (file)
@@ -1775,7 +1775,7 @@ _GLIBCXX_END_NAMESPACE_CONTAINER
 #if __cplusplus > 201703L
 namespace ranges::__detail
 {
-  template<typename _Tp> inline constexpr bool __enable_view_impl;
+  template<typename _Tp> extern inline const bool __enable_view_impl;
   template<typename _Val, typename _Hash, typename _Eq, typename _Alloc>
     inline constexpr bool
       __enable_view_impl<_GLIBCXX_STD_C::unordered_set<_Val, _Hash, _Eq,
index 00c5bcc0f24f58affc0b7c6da184da4903e5f87f..62c7672dfb64d94d37b004d55b8a16b87646bb19 100644 (file)
@@ -635,7 +635,7 @@ namespace __debug
 _GLIBCXX_BEGIN_NAMESPACE_VERSION
 namespace ranges::__detail
 {
-  template<typename _Tp> inline constexpr bool __enable_view_impl;
+  template<typename _Tp> extern inline const bool __enable_view_impl;
   template<typename _Key, typename _Compare, typename _Alloc>
     inline constexpr bool
       __enable_view_impl<std::__debug::multiset<_Key, _Compare, _Alloc>>
index 16eee2947c913b305ee4c64bd63d9e1e24dcc6e3..8d0852a6af853c4fdaa2759b38f85f3cd0be6a47 100644 (file)
@@ -646,7 +646,7 @@ namespace __debug
 _GLIBCXX_BEGIN_NAMESPACE_VERSION
 namespace ranges::__detail
 {
-  template<typename _Tp> inline constexpr bool __enable_view_impl;
+  template<typename _Tp> extern inline const bool __enable_view_impl;
   template<typename _Key, typename _Compare, typename _Alloc>
     inline constexpr bool
       __enable_view_impl<std::__debug::set<_Key, _Compare, _Alloc>> = false;
index 5dbb754a1002a6fb70238921a8838f850c78fa99..4b814cb20e0be906d2012423011b9deff54a7818 100644 (file)
@@ -1187,7 +1187,7 @@ namespace __debug
 _GLIBCXX_BEGIN_NAMESPACE_VERSION
 namespace ranges::__detail
 {
-  template<typename _Tp> inline constexpr bool __enable_view_impl;
+  template<typename _Tp> extern inline const bool __enable_view_impl;
   template<typename _Val, typename _Hash, typename _Eq, typename _Alloc>
     inline constexpr bool
       __enable_view_impl<std::__debug::unordered_set<_Val, _Hash, _Eq, _Alloc>>