diff mbox

Try to catch up _GLIBCXX_RESOLVE_LIB_DEFECTS comments and documentation.

Message ID 532467D4.9080407@verizon.net
State New
Headers show

Commit Message

Ed Smith-Rowland March 15, 2014, 2:46 p.m. UTC
I'm resending this because I forgot to dupe to gcc-patches and I'd like 
one thread.

This should be pure commentary and documentation.

I hope I got all these.  I grepped for DR and added 
_GLIBCXX_RESOLVE_LIB_DEFECTS where it seemed needed.
I did not add in cases where DR mentions were more commentary.

Then I added the new _GLIBCXX_RESOLVE_LIB_DEFECTS to the xml intro page.

OK?  Can anyone think of one I left out?

Ed
2014-03-15  Ed Smith-Rowland  <3dw4rd@verizon.net>

	* include/bits/allocator.h: Add CL_GLIBCXX_RESOLVE_LIB_DEFECTS.
	* include/bits/basic_string.h: Ditto.
	* include/bits/hashtable.h: Ditto.
	* include/bits/istream.tcc: Ditto.
	* include/bits/stl_algo.h: Ditto.
	* include/bits/stl_algobase.h: Ditto.
	* include/bits/stl_bvector.h: Ditto.
	* include/bits/stl_deque.h: Ditto.
	* include/std/array: Ditto.
	* include/std/bitset: Ditto.
	* include/std/chrono: Ditto.
	* include/std/complex: Ditto.
	* include/std/condition_variable: Ditto.
	* include/std/system_error: Ditto.
	* include/std/thread: Ditto.
	* include/std/tuple: Ditto.
	* include/std/type_traits: Ditto.
	* doc/xml/manual/intro.xml: Add implemented DRs to Standard Bugs list.

Comments

Jonathan Wakely March 16, 2014, 12:43 p.m. UTC | #1
On 15 March 2014 14:46, Ed Smith-Rowland wrote:
> I'm resending this because I forgot to dupe to gcc-patches and I'd like one
> thread.
>
> This should be pure commentary and documentation.
>
> I hope I got all these.  I grepped for DR and added
> _GLIBCXX_RESOLVE_LIB_DEFECTS where it seemed needed.
> I did not add in cases where DR mentions were more commentary.
>
> Then I added the new _GLIBCXX_RESOLVE_LIB_DEFECTS to the xml intro page.
>
> OK?  Can anyone think of one I left out?

In many of these cases I'd actually prefer to remove the comment
mentioning a DR, rather than add the RESOLVE_LIB_DEFECTS marker.

For example:

DR 1204: this says we don't need to check for self-move-assignment. It
applies to every move assignment operator in the library. It is not a
defect against C++03, and the resolution is part of the final C++11
standard, so I don't think we should document that we implement it.

DR 1261: another one with "C++11" status, meaning it was included in
the C++11 standard, and this one also isn't relevant to C++03, so of
course we implement it, and we shouldn't even mention it in comments
or docs.

DR 675, DR 776: these aren't relevant to C++03, and are part of C++11
(since the CD1 draft)

So I think adding RESOLVE_LIB_DEFECTS is the wrong thing to do, I'd
rather not touch them.  Personally I'm in favour of completely remove
any mention of DRs that are fixes to C++0x drafts, not post-C++11
fixes, but that might be more controversial.
Ed Smith-Rowland March 16, 2014, 4:09 p.m. UTC | #2
On 03/16/2014 08:43 AM, Jonathan Wakely wrote:
> On 15 March 2014 14:46, Ed Smith-Rowland wrote:
>> I'm resending this because I forgot to dupe to gcc-patches and I'd like one
>> thread.
>>
>> This should be pure commentary and documentation.
>>
>> I hope I got all these.  I grepped for DR and added
>> _GLIBCXX_RESOLVE_LIB_DEFECTS where it seemed needed.
>> I did not add in cases where DR mentions were more commentary.
>>
>> Then I added the new _GLIBCXX_RESOLVE_LIB_DEFECTS to the xml intro page.
>>
>> OK?  Can anyone think of one I left out?
> In many of these cases I'd actually prefer to remove the comment
> mentioning a DR, rather than add the RESOLVE_LIB_DEFECTS marker.
>
> For example:
>
> DR 1204: this says we don't need to check for self-move-assignment. It
> applies to every move assignment operator in the library. It is not a
> defect against C++03, and the resolution is part of the final C++11
> standard, so I don't think we should document that we implement it.
>
> DR 1261: another one with "C++11" status, meaning it was included in
> the C++11 standard, and this one also isn't relevant to C++03, so of
> course we implement it, and we shouldn't even mention it in comments
> or docs.
>
> DR 675, DR 776: these aren't relevant to C++03, and are part of C++11
> (since the CD1 draft)
>
> So I think adding RESOLVE_LIB_DEFECTS is the wrong thing to do, I'd
> rather not touch them.  Personally I'm in favour of completely remove
> any mention of DRs that are fixes to C++0x drafts, not post-C++11
> fixes, but that might be more controversial.
>
OK, thinking further on it I actually agree with not mentioning DRs on a 
partially baked standard.  We advertise that support for new standards 
is experimental.

This whole thing is less of a deal now that the standard is moving so 
quickly and problems are easily incorporated into the next standard.

I'll put something new out tonight or tomorrow.
Jonathan Wakely March 17, 2014, 10:33 a.m. UTC | #3
On 16 March 2014 16:09, Ed Smith-Rowland wrote:
> OK, thinking further on it I actually agree with not mentioning DRs on a
> partially baked standard.  We advertise that support for new standards is
> experimental.

I don't think it does any harm to add comments during the C++1y/C++1z
process to note that we've incorporated a particular DR against an
earlier working paper, because it's not always obvious which draft our
work-in-progress follows, but once the standard is finished I'd be in
favour of removing those comments. Implementing those DRs is implied
by implementing the finished standard.
diff mbox

Patch

Index: include/bits/allocator.h
===================================================================
--- include/bits/allocator.h	(revision 208526)
+++ include/bits/allocator.h	(working copy)
@@ -155,6 +155,7 @@ 
   // Undefine.
 #undef __allocator_base
 
+  // _GLIBCXX_RESOLVE_LIB_DEFECTS
   // To implement Option 3 of DR 431.
   template<typename _Alloc, bool = __is_empty(_Alloc)>
     struct __alloc_swap
Index: include/bits/basic_string.h
===================================================================
--- include/bits/basic_string.h	(revision 208526)
+++ include/bits/basic_string.h	(working copy)
@@ -588,6 +588,7 @@ 
       basic_string&
       operator=(basic_string&& __str)
       {
+	// _GLIBCXX_RESOLVE_LIB_DEFECTS
 	// NB: DR 1204.
 	this->swap(__str);
 	return *this;
@@ -2878,6 +2879,7 @@ 
 
   // NB: (v)snprintf vs sprintf.
 
+  // _GLIBCXX_RESOLVE_LIB_DEFECTS
   // DR 1261.
   inline string
   to_string(int __val)
@@ -2979,6 +2981,7 @@ 
   stold(const wstring& __str, size_t* __idx = 0)
   { return __gnu_cxx::__stoa(&std::wcstold, "stold", __str.c_str(), __idx); }
 
+  // _GLIBCXX_RESOLVE_LIB_DEFECTS
   // DR 1261.
   inline wstring
   to_wstring(int __val)
@@ -3055,6 +3058,7 @@ 
 {
 _GLIBCXX_BEGIN_NAMESPACE_VERSION
 
+  // _GLIBCXX_RESOLVE_LIB_DEFECTS
   // DR 1182.
 
 #ifndef _GLIBCXX_COMPATIBILITY_CXX0X
Index: include/bits/hashtable.h
===================================================================
--- include/bits/hashtable.h	(revision 208526)
+++ include/bits/hashtable.h	(working copy)
@@ -527,6 +527,7 @@ 
       end(size_type __n) const
       { return const_local_iterator(*this, nullptr, __n, _M_bucket_count); }
 
+      // _GLIBCXX_RESOLVE_LIB_DEFECTS
       // DR 691.
       const_local_iterator
       cbegin(size_type __n) const
@@ -723,6 +724,7 @@ 
       // Set number of buckets to be appropriate for container of n element.
       void rehash(size_type __n);
 
+      // _GLIBCXX_RESOLVE_LIB_DEFECTS
       // DR 1189.
       // reserve, if present, comes from _Rehash_base.
 
Index: include/bits/istream.tcc
===================================================================
--- include/bits/istream.tcc	(revision 208526)
+++ include/bits/istream.tcc	(working copy)
@@ -781,7 +781,7 @@ 
     sync(void)
     {
       // _GLIBCXX_RESOLVE_LIB_DEFECTS
-      // DR60.  Do not change _M_gcount.
+      // DR 60.  Do not change _M_gcount.
       int __ret = -1;
       sentry __cerb(*this, true);
       if (__cerb)
@@ -817,7 +817,7 @@ 
     tellg(void)
     {
       // _GLIBCXX_RESOLVE_LIB_DEFECTS
-      // DR60.  Do not change _M_gcount.
+      // DR 60.  Do not change _M_gcount.
       pos_type __ret = pos_type(-1);
       sentry __cerb(*this, true);
       if (__cerb)
@@ -845,7 +845,7 @@ 
     seekg(pos_type __pos)
     {
       // _GLIBCXX_RESOLVE_LIB_DEFECTS
-      // DR60.  Do not change _M_gcount.
+      // DR 60.  Do not change _M_gcount.
       // Clear eofbit per N3168.
       this->clear(this->rdstate() & ~ios_base::eofbit);
       sentry __cerb(*this, true);
@@ -884,7 +884,7 @@ 
     seekg(off_type __off, ios_base::seekdir __dir)
     {
       // _GLIBCXX_RESOLVE_LIB_DEFECTS
-      // DR60.  Do not change _M_gcount.
+      // DR 60.  Do not change _M_gcount.
       // Clear eofbit per N3168.
       this->clear(this->rdstate() & ~ios_base::eofbit);
       sentry __cerb(*this, true);
Index: include/bits/stl_algo.h
===================================================================
--- include/bits/stl_algo.h	(revision 208526)
+++ include/bits/stl_algo.h	(working copy)
@@ -3433,6 +3433,7 @@ 
 				   __gnu_cxx::__ops::__iter_comp_iter(__comp));
     }
 
+  // _GLIBCXX_RESOLVE_LIB_DEFECTS
   // N2722 + DR 915.
   template<typename _Tp>
     inline _Tp
Index: include/bits/stl_algobase.h
===================================================================
--- include/bits/stl_algobase.h	(revision 208526)
+++ include/bits/stl_algobase.h	(working copy)
@@ -75,6 +75,7 @@ 
 _GLIBCXX_BEGIN_NAMESPACE_VERSION
 
 #if __cplusplus < 201103L
+  // _GLIBCXX_RESOLVE_LIB_DEFECTS
   // See http://gcc.gnu.org/ml/libstdc++/2004-08/msg00167.html: in a
   // nutshell, we are partially implementing the resolution of DR 187,
   // when it's safe, i.e., the value_types are equal.
Index: include/bits/stl_bvector.h
===================================================================
--- include/bits/stl_bvector.h	(revision 208526)
+++ include/bits/stl_bvector.h	(working copy)
@@ -647,6 +647,7 @@ 
     vector&
     operator=(vector&& __x)
     {
+      // _GLIBCXX_RESOLVE_LIB_DEFECTS
       // NB: DR 1204.
       // NB: DR 675.
       this->clear();
@@ -1184,6 +1185,7 @@ 
 {
 _GLIBCXX_BEGIN_NAMESPACE_VERSION
 
+  // _GLIBCXX_RESOLVE_LIB_DEFECTS
   // DR 1182.
   /// std::hash specialization for vector<bool>.
   template<typename _Alloc>
Index: include/bits/stl_deque.h
===================================================================
--- include/bits/stl_deque.h	(revision 208526)
+++ include/bits/stl_deque.h	(working copy)
@@ -943,6 +943,7 @@ 
       deque&
       operator=(deque&& __x) noexcept
       {
+	// _GLIBCXX_RESOLVE_LIB_DEFECTS
 	// NB: DR 1204.
 	// NB: DR 675.
 	this->clear();
Index: include/std/array
===================================================================
--- include/std/array	(revision 208526)
+++ include/std/array	(working copy)
@@ -98,6 +98,7 @@ 
 
       // No explicit construct/copy/destroy for aggregate type.
 
+      // _GLIBCXX_RESOLVE_LIB_DEFECTS
       // DR 776.
       void
       fill(const value_type& __u)
Index: include/std/bitset
===================================================================
--- include/std/bitset	(revision 208526)
+++ include/std/bitset	(working copy)
@@ -1556,6 +1556,7 @@ 
 {
 _GLIBCXX_BEGIN_NAMESPACE_VERSION
 
+  // _GLIBCXX_RESOLVE_LIB_DEFECTS
   // DR 1182.
   /// std::hash specialization for bitset.
   template<size_t _Nb>
Index: include/std/chrono
===================================================================
--- include/std/chrono	(revision 208526)
+++ include/std/chrono	(working copy)
@@ -337,6 +337,7 @@ 
 	  return *this;
 	}
 
+	// _GLIBCXX_RESOLVE_LIB_DEFECTS
 	// DR 934.
 	template<typename _Rep2 = rep>
 	  typename enable_if<!treat_as_floating_point<_Rep2>::value,
@@ -446,6 +447,7 @@ 
 	return __cd(__lhs).count() / __cd(__rhs).count();
       }
 
+    // _GLIBCXX_RESOLVE_LIB_DEFECTS
     // DR 934.
     template<typename _Rep1, typename _Period, typename _Rep2>
       constexpr duration<typename __common_rep_type<_Rep1, typename
Index: include/std/complex
===================================================================
--- include/std/complex	(revision 208526)
+++ include/std/complex	(working copy)
@@ -1571,6 +1571,7 @@ 
   template<typename _Tp> std::complex<_Tp> acosh(const std::complex<_Tp>&);
   template<typename _Tp> std::complex<_Tp> asinh(const std::complex<_Tp>&);
   template<typename _Tp> std::complex<_Tp> atanh(const std::complex<_Tp>&);
+  // _GLIBCXX_RESOLVE_LIB_DEFECTS
   // DR 595.
   template<typename _Tp> _Tp               fabs(const std::complex<_Tp>&);
 
@@ -1875,6 +1876,7 @@ 
     }
 
   // Forward declarations.
+  // _GLIBCXX_RESOLVE_LIB_DEFECTS
   // DR 781.
   template<typename _Tp> std::complex<_Tp> proj(const std::complex<_Tp>&);
 
@@ -1913,6 +1915,7 @@ 
     { return __complex_proj(__z); }
 #endif
 
+  // _GLIBCXX_RESOLVE_LIB_DEFECTS
   // DR 1137.
   template<typename _Tp>
     inline typename __gnu_cxx::__promote<_Tp>::__type
Index: include/std/condition_variable
===================================================================
--- include/std/condition_variable	(revision 208526)
+++ include/std/condition_variable	(working copy)
@@ -109,6 +109,7 @@ 
       wait_until(unique_lock<mutex>& __lock,
 		 const chrono::time_point<_Clock, _Duration>& __atime)
       {
+	// _GLIBCXX_RESOLVE_LIB_DEFECTS
 	// DR 887 - Sync unknown clock to known clock.
 	const typename _Clock::time_point __c_entry = _Clock::now();
 	const __clock_t::time_point __s_entry = __clock_t::now();
Index: include/std/system_error
===================================================================
--- include/std/system_error	(revision 208526)
+++ include/std/system_error	(working copy)
@@ -105,6 +105,7 @@ 
     { return this != &__other; }
   };
 
+  // _GLIBCXX_RESOLVE_LIB_DEFECTS
   // DR 890.
   _GLIBCXX_CONST const error_category& system_category() noexcept;
   _GLIBCXX_CONST const error_category& generic_category() noexcept;
@@ -140,6 +141,7 @@ 
     clear() noexcept
     { assign(0, system_category()); }
 
+    // _GLIBCXX_RESOLVE_LIB_DEFECTS
     // DR 804.
     template<typename _ErrorCodeEnum>
       typename enable_if<is_error_code_enum<_ErrorCodeEnum>::value,
@@ -163,6 +165,7 @@ 
     explicit operator bool() const noexcept
     { return _M_value != 0 ? true : false; }
 
+    // _GLIBCXX_RESOLVE_LIB_DEFECTS
     // DR 804.
   private:
     friend class hash<error_code>;
@@ -213,6 +216,7 @@ 
       _M_cat = &__cat;
     }
 
+    // _GLIBCXX_RESOLVE_LIB_DEFECTS
     // DR 804.
     template<typename _ErrorConditionEnum>
       typename enable_if<is_error_condition_enum
@@ -238,6 +242,7 @@ 
     explicit operator bool() const noexcept
     { return _M_value != 0 ? true : false; }
 
+    // _GLIBCXX_RESOLVE_LIB_DEFECTS
     // DR 804.
   private:
     int 			_M_value;
@@ -357,6 +362,7 @@ 
 {
 _GLIBCXX_BEGIN_NAMESPACE_VERSION
 
+  // _GLIBCXX_RESOLVE_LIB_DEFECTS
   // DR 1182.
   /// std::hash specialization for error_code.
   template<>
Index: include/std/thread
===================================================================
--- include/std/thread	(revision 208526)
+++ include/std/thread	(working copy)
@@ -216,6 +216,7 @@ 
   operator>=(thread::id __x, thread::id __y) noexcept
   { return !(__x < __y); }
 
+  // _GLIBCXX_RESOLVE_LIB_DEFECTS
   // DR 889.
   /// std::hash specialization for thread::id.
   template<>
Index: include/std/tuple
===================================================================
--- include/std/tuple	(revision 208526)
+++ include/std/tuple	(working copy)
@@ -879,6 +879,7 @@ 
 	       const tuple<_UElements...>& __u)
     { return !(__t < __u); }
 
+  // _GLIBCXX_RESOLVE_LIB_DEFECTS
   // NB: DR 705.
   template<typename... _Elements>
     constexpr tuple<typename __decay_and_strip<_Elements>::__type...>
Index: include/std/type_traits
===================================================================
--- include/std/type_traits	(revision 208526)
+++ include/std/type_traits	(working copy)
@@ -1845,6 +1845,7 @@ 
 	   bool _IsFunction = is_function<_Up>::value> 
     struct __decay_selector;
 
+  // _GLIBCXX_RESOLVE_LIB_DEFECTS
   // NB: DR 705.
   template<typename _Up> 
     struct __decay_selector<_Up, false, false>
Index: doc/xml/manual/intro.xml
===================================================================
--- doc/xml/manual/intro.xml	(revision 208526)
+++ doc/xml/manual/intro.xml	(working copy)
@@ -718,6 +718,12 @@ 
     <listitem><para>Change it to be a formatted output function (i.e. catch exceptions).
     </para></listitem></varlistentry>
 
+    <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#595">595</link>:
+	<emphasis>TR1/C++0x: fabs(complex<T>) redundant / wrongly specified</emphasis>
+    </term>
+    <listitem><para>Change the return type of fabs(complex) to T.
+    </para></listitem></varlistentry>
+
     <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#596">596</link>:
 	<emphasis>27.8.1.3 Table 112 omits "a+" and "a+b" modes</emphasis>
     </term>
@@ -761,6 +767,12 @@ 
     <listitem><para>Implement the straightforward resolution.
     </para></listitem></varlistentry>
 
+    <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#705">705</link>:
+	<emphasis>type-trait decay incompletely specified</emphasis>
+    </term>
+    <listitem><para>Strip cv qualification from std::decay.
+    </para></listitem></varlistentry>
+
     <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#761">761</link>:
 	<emphasis>unordered_map needs an at() member function</emphasis>
     </term>
@@ -785,6 +797,12 @@ 
     <listitem><para>In C++11 mode, add std::proj.
     </para></listitem></varlistentry>
 
+    <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#804">804</link>:
+	<emphasis>Some problems with classes error_code/error_condition</emphasis>
+    </term>
+    <listitem><para>Store and compare error_category by pointer rather than reference.
+    </para></listitem></varlistentry>
+
     <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#809">809</link>:
 	<emphasis>std::swap should be overloaded for array types</emphasis>
     </term>
@@ -803,6 +821,55 @@ 
     <listitem><para>The traditional HP / SGI return type and value is blessed
 		    by the resolution of the DR.
     </para></listitem></varlistentry>
+
+    <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#889">889</link>:
+	<emphasis>thread::id comparisons</emphasis>
+    </term>
+    <listitem><para>Add hases for thread::id
+    </para></listitem></varlistentry>
+
+    <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#890">890</link>:
+	<emphasis>Improving system_error initialization</emphasis>
+    </term>
+    <listitem><para>Initialize system_error with default constructed system_category and generic_category.
+    </para></listitem></varlistentry>
+
+    <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#934">934</link>:
+	<emphasis>duration is missing operator%</emphasis>
+    </term>
+    <listitem><para>Add modulus operator to duration: duration& operator%=(const duration& d).
+    </para></listitem></varlistentry>
+
+    <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#1137">1137</link>:
+	<emphasis>Return type of conj and proj</emphasis>
+    </term>
+    <listitem><para>All specified overloads shall have a return type which is the nested value_type
+     of the effectively cast arguments.</para></listitem></varlistentry>
+
+    <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#1182">1182</link>:
+	<emphasis>Unfortunate hash dependencies</emphasis>
+    </term>
+    <listitem><para>Add many more hash specializations.
+    </para></listitem></varlistentry>
+
+    <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#1189">1189</link>:
+	<emphasis>Awkward interface for changing the number of buckets in an unordered associative container</emphasis>
+    </term>
+    <listitem><para>Add a new reserve method to the unordered associateve containers.
+    </para></listitem></varlistentry>
+
+    <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#1204">1204</link>:
+	<emphasis>Global permission to move</emphasis>
+    </term>
+    <listitem><para>Provide global permission to move
+    </para></listitem></varlistentry>
+
+    <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#1261">1261</link>:
+	<emphasis>Insufficent overloads for to_string and to_wstring</emphasis>
+    </term>
+    <listitem><para>Add new overloads for to_string and to_wstring for many new fundamental integral
+    and floating point types.</para></listitem></varlistentry>
+
   </variablelist>
 
  </section>