summaryrefslogtreecommitdiff
path: root/libstdc++-v3
diff options
context:
space:
mode:
authorredi <redi@138bc75d-0d04-0410-961f-82ee72b054a4>2014-09-24 22:13:35 +0000
committerredi <redi@138bc75d-0d04-0410-961f-82ee72b054a4>2014-09-24 22:13:35 +0000
commit65eba18bbe122c7e274a81aace7e7290645245c8 (patch)
tree0e959cb12a69e0a0672b41213a3c61b9b6b8261f /libstdc++-v3
parentc9f582474ee89860ab4999c360b5cc32a936a104 (diff)
downloadgcc-65eba18bbe122c7e274a81aace7e7290645245c8.tar.gz
PR libstdc++/56193
* config/abi/pre/gnu.ver: Add new exports. * include/bits/basic_ios.h (basic_ios::operator bool): Define. * src/c++98/ios_locale.cc (basic_ios::operator void*): Instantiate. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@215571 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3')
-rw-r--r--libstdc++-v3/ChangeLog5
-rw-r--r--libstdc++-v3/config/abi/pre/gnu.ver3
-rw-r--r--libstdc++-v3/include/bits/basic_ios.h5
-rw-r--r--libstdc++-v3/src/c++98/ios_locale.cc7
4 files changed, 20 insertions, 0 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index 5f53cddd2f8..34a3d003eb1 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -3,6 +3,11 @@
* config/abi/pre/gnu.ver: Make GLIBCXX_3.4 patterns stricter so the
new GLIBCXX_3.4.21 symbols don't match them.
+ PR libstdc++/56193
+ * config/abi/pre/gnu.ver: Add new exports.
+ * include/bits/basic_ios.h (basic_ios::operator bool): Define.
+ * src/c++98/ios_locale.cc (basic_ios::operator void*): Instantiate.
+
2014-09-24 François Dumont <fdumont@gcc.gnu.org>
PR libstdc++/29988
diff --git a/libstdc++-v3/config/abi/pre/gnu.ver b/libstdc++-v3/config/abi/pre/gnu.ver
index 63985fd8538..0559444a87b 100644
--- a/libstdc++-v3/config/abi/pre/gnu.ver
+++ b/libstdc++-v3/config/abi/pre/gnu.ver
@@ -1470,6 +1470,9 @@ GLIBCXX_3.4.21 {
_ZNSoC[12]ERSd;
_ZNSt13basic_ostreamIwSt11char_traitsIwEEC[12]ERSt14basic_iostreamIwS1_E;
+ # std::basic_ios::operator bool() const
+ _ZNKSt9basic_iosI[cw]St11char_traitsI[cw]EEcvbEv;
+
} GLIBCXX_3.4.20;
diff --git a/libstdc++-v3/include/bits/basic_ios.h b/libstdc++-v3/include/bits/basic_ios.h
index 10263ed07a4..0a83d0d1f28 100644
--- a/libstdc++-v3/include/bits/basic_ios.h
+++ b/libstdc++-v3/include/bits/basic_ios.h
@@ -113,8 +113,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
* This allows you to write constructs such as
* <code>if (!a_stream) ...</code> and <code>while (a_stream) ...</code>
*/
+#if __cplusplus >= 201103L
+ explicit operator bool() const
+ { return !this->fail(); }
+#else
operator void*() const
{ return this->fail() ? 0 : const_cast<basic_ios*>(this); }
+#endif
bool
operator!() const
diff --git a/libstdc++-v3/src/c++98/ios_locale.cc b/libstdc++-v3/src/c++98/ios_locale.cc
index fd2e9e430d8..968af981f41 100644
--- a/libstdc++-v3/src/c++98/ios_locale.cc
+++ b/libstdc++-v3/src/c++98/ios_locale.cc
@@ -54,5 +54,12 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
return __old;
}
+ // Explicit instantiations for basic_ios are done in src/c++11/ios.cc
+ // and so do not include this member, which is only defined for C++98.
+ template basic_ios<char>::operator void*() const;
+#ifdef _GLIBCXX_USE_WCHAR_T
+ template basic_ios<wchar_t>::operator void*() const;
+#endif
+
_GLIBCXX_END_NAMESPACE_VERSION
} // namespace