aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2021-11-11 13:02:16 +0000
committerJonathan Wakely <jwakely@redhat.com>2021-11-11 18:16:17 +0000
commitef0e100f5870bbb792f378858864f915696dd232 (patch)
tree1e8384867f7dd146d30cfe137fd73bf91d1ff667
parentdc002e31fb2d001703278263ea3d1cef366018ae (diff)
downloadgcc-ef0e100f5870bbb792f378858864f915696dd232.zip
gcc-ef0e100f5870bbb792f378858864f915696dd232.tar.gz
gcc-ef0e100f5870bbb792f378858864f915696dd232.tar.bz2
libstdc++: Remove public std::vector<bool>::data() member
This function only exists to avoid an error in the debug mode vector, so doesn't need to be public. libstdc++-v3/ChangeLog: * include/bits/stl_bvector.h (vector<bool>::data()): Give protected access, and delete for C++11 and later.
-rw-r--r--libstdc++-v3/include/bits/stl_bvector.h22
1 files changed, 13 insertions, 9 deletions
diff --git a/libstdc++-v3/include/bits/stl_bvector.h b/libstdc++-v3/include/bits/stl_bvector.h
index 3778d5a..31d8784 100644
--- a/libstdc++-v3/include/bits/stl_bvector.h
+++ b/libstdc++-v3/include/bits/stl_bvector.h
@@ -996,14 +996,6 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
back() const
{ return *(end() - 1); }
- // _GLIBCXX_RESOLVE_LIB_DEFECTS
- // DR 464. Suggestion for new member functions in standard containers.
- // N.B. DR 464 says nothing about vector<bool> but we need something
- // here due to the way we are implementing DR 464 in the debug-mode
- // vector class.
- void
- data() _GLIBCXX_NOEXCEPT { }
-
void
push_back(bool __x)
{
@@ -1363,7 +1355,19 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
iterator
_M_erase(iterator __first, iterator __last);
- };
+
+ protected:
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // DR 464. Suggestion for new member functions in standard containers.
+ // N.B. DR 464 says nothing about vector<bool> but we need something
+ // here due to the using-declaration in __gnu_debug::vector.
+ // vector class.
+#if __cplusplus >= 201103L
+ void data() = delete;
+#else
+ void data() { }
+#endif
+ };
_GLIBCXX_END_NAMESPACE_CONTAINER