This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
[Patch] Fix libstdc++/12657
- From: Paolo Carlini <pcarlini at suse dot de>
- To: libstdc++ at gcc dot gnu dot org
- Date: Wed, 22 Oct 2003 11:31:37 +0200
- Subject: [Patch] Fix libstdc++/12657
Hi,
seems straightforward to me... Will wait a bit for comments,
then commit to mainline.
Tested x86-linux.
Paolo.
///////////
2003-10-22 Paolo Carlini <pcarlini@suse.de>
PR libstdc++/12657
* include/bits/basic_ios.tcc (copyfmt(const basic_ios&)):
Implement resolution of DR 292 (WP).
* docs/html/ext/howto.html: Add entry for DR 292.
diff -urN libstdc++-v3-1/docs/html/ext/howto.html libstdc++-v3/docs/html/ext/howto.html
--- libstdc++-v3-1/docs/html/ext/howto.html 2003-08-12 10:46:43.000000000 +0200
+++ libstdc++-v3/docs/html/ext/howto.html 2003-10-22 11:29:04.000000000 +0200
@@ -640,6 +640,12 @@
<dd>Similar to 118.
</dd>
+ <dt><a href="lwg-defects.html#292">292</a>:
+ <em>Effects of a.copyfmt (a)</em>
+ </dt>
+ <dd>If <code>(this == &rhs)</code> do nothing.
+ </dd>
+
<!--
<dt><a href="lwg-defects.html#"></a>:
<em></em>
diff -urN libstdc++-v3-1/include/bits/basic_ios.tcc libstdc++-v3/include/bits/basic_ios.tcc
--- libstdc++-v3-1/include/bits/basic_ios.tcc 2003-08-12 05:46:17.000000000 +0200
+++ libstdc++-v3/include/bits/basic_ios.tcc 2003-10-22 10:46:21.000000000 +0200
@@ -60,6 +60,11 @@
basic_ios<_CharT, _Traits>&
basic_ios<_CharT, _Traits>::copyfmt(const basic_ios& __rhs)
{
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 292. effects of a.copyfmt (a)
+ if (this == &__rhs)
+ return *this;
+
// Per 27.1.1, do not call imbue, yet must trash all caches
// associated with imbue()