public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* _Rb_tree regression
@ 2016-12-13 21:51 François Dumont
  2016-12-14 11:29 ` Jonathan Wakely
  0 siblings, 1 reply; 5+ messages in thread
From: François Dumont @ 2016-12-13 21:51 UTC (permalink / raw)
  To: libstdc++, gcc-patches; +Cc: Christophe MONAT

[-- Attachment #1: Type: text/plain, Size: 646 bytes --]

Hi

     I have been reported privately by Christophe in copy a regression 
resulting from my recent changes to _Rb_tree. I removed a constructor 
still necessary in C++03 mode or before. Tests would have shown it if I 
had run them in C++03.

     * include/bits/stl_tree.h
     (_Rb_tree_impl(const _Key_compare&, const _Node_allocator&): Restore
     before C++11 mode.

     I prefer to restore it only before C++11 while it used to be 
available in any mode. It is only call with rvalue references. Don't 
hesitate to commit it yourself if you prefer to fix it quickly otherwise 
I'll do it after validation in about 24 hours.

François


[-- Attachment #2: stl_tree.patch --]
[-- Type: text/x-patch, Size: 691 bytes --]

diff --git a/libstdc++-v3/include/bits/stl_tree.h b/libstdc++-v3/include/bits/stl_tree.h
index 1bfbfa7..cb2c116 100644
--- a/libstdc++-v3/include/bits/stl_tree.h
+++ b/libstdc++-v3/include/bits/stl_tree.h
@@ -692,7 +692,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 	  , _Base_key_compare(__x._M_key_compare)
 	  { }
 
-#if __cplusplus >= 201103L
+#if __cplusplus < 201103L
+	  _Rb_tree_impl(const _Key_compare& __comp, const _Node_allocator& __a)
+	  : _Node_allocator(__a), _Base_key_compare(__comp)
+	  { }
+#else
 	  _Rb_tree_impl(_Rb_tree_impl&&) = default;
 	  _Rb_tree_impl(const _Key_compare& __comp, _Node_allocator&& __a)
 	  : _Node_allocator(std::move(__a)), _Base_key_compare(__comp)

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: _Rb_tree regression
  2016-12-13 21:51 _Rb_tree regression François Dumont
@ 2016-12-14 11:29 ` Jonathan Wakely
  2016-12-14 11:36   ` Jonathan Wakely
  2016-12-14 11:54   ` Jonathan Wakely
  0 siblings, 2 replies; 5+ messages in thread
From: Jonathan Wakely @ 2016-12-14 11:29 UTC (permalink / raw)
  To: François Dumont; +Cc: libstdc++, gcc-patches, Christophe MONAT

On 13/12/16 22:51 +0100, François Dumont wrote:
>Hi
>
>    I have been reported privately by Christophe in copy a regression 
>resulting from my recent changes to _Rb_tree. I removed a constructor 
>still necessary in C++03 mode or before. Tests would have shown it if 
>I had run them in C++03.

For reference:

  make check RUNTESTFLAGS=--target_board=unix/-std=gnu++03

On trunk this will run almost the entire testsuite as C++03.

>    * include/bits/stl_tree.h
>    (_Rb_tree_impl(const _Key_compare&, const _Node_allocator&): Restore
>    before C++11 mode.
>
>    I prefer to restore it only before C++11 while it used to be 
>available in any mode. It is only call with rvalue references. Don't 

It's only called with *rvalues* (not rvalue references) but for C++11
and up we have a constructor taking an rvalue reference, so I agree
that the constructor taking a const lvalue reference is only needed
for C++03.

>hesitate to commit it yourself if you prefer to fix it quickly 
>otherwise I'll do it after validation in about 24 hours.

OK, thanks, please commit as soon as testing completes.


>François
>

>diff --git a/libstdc++-v3/include/bits/stl_tree.h b/libstdc++-v3/include/bits/stl_tree.h
>index 1bfbfa7..cb2c116 100644
>--- a/libstdc++-v3/include/bits/stl_tree.h
>+++ b/libstdc++-v3/include/bits/stl_tree.h
>@@ -692,7 +692,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
> 	  , _Base_key_compare(__x._M_key_compare)
> 	  { }
> 
>-#if __cplusplus >= 201103L
>+#if __cplusplus < 201103L
>+	  _Rb_tree_impl(const _Key_compare& __comp, const _Node_allocator& __a)
>+	  : _Node_allocator(__a), _Base_key_compare(__comp)
>+	  { }
>+#else
> 	  _Rb_tree_impl(_Rb_tree_impl&&) = default;
> 	  _Rb_tree_impl(const _Key_compare& __comp, _Node_allocator&& __a)
> 	  : _Node_allocator(std::move(__a)), _Base_key_compare(__comp)

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: _Rb_tree regression
  2016-12-14 11:29 ` Jonathan Wakely
@ 2016-12-14 11:36   ` Jonathan Wakely
  2016-12-14 11:54   ` Jonathan Wakely
  1 sibling, 0 replies; 5+ messages in thread
From: Jonathan Wakely @ 2016-12-14 11:36 UTC (permalink / raw)
  To: François Dumont; +Cc: libstdc++, gcc-patches, Christophe MONAT

On 14/12/16 11:27 +0000, Jonathan Wakely wrote:
>On 13/12/16 22:51 +0100, François Dumont wrote:
>>Hi
>>
>>   I have been reported privately by Christophe in copy a regression 
>>resulting from my recent changes to _Rb_tree. I removed a 
>>constructor still necessary in C++03 mode or before. Tests would 
>>have shown it if I had run them in C++03.
>
>For reference:
>
> make check RUNTESTFLAGS=--target_board=unix/-std=gnu++03
>
>On trunk this will run almost the entire testsuite as C++03.
>
>>   * include/bits/stl_tree.h
>>   (_Rb_tree_impl(const _Key_compare&, const _Node_allocator&): Restore
>>   before C++11 mode.
>>
>>   I prefer to restore it only before C++11 while it used to be 
>>available in any mode. It is only call with rvalue references. Don't
>
>It's only called with *rvalues* (not rvalue references) but for C++11
>and up we have a constructor taking an rvalue reference, so I agree
>that the constructor taking a const lvalue reference is only needed
>for C++03.
>
>>hesitate to commit it yourself if you prefer to fix it quickly 
>>otherwise I'll do it after validation in about 24 hours.
>
>OK, thanks, please commit as soon as testing completes.
>
>
>>François
>>
>
>>diff --git a/libstdc++-v3/include/bits/stl_tree.h b/libstdc++-v3/include/bits/stl_tree.h
>>index 1bfbfa7..cb2c116 100644
>>--- a/libstdc++-v3/include/bits/stl_tree.h
>>+++ b/libstdc++-v3/include/bits/stl_tree.h
>>@@ -692,7 +692,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
>>	  , _Base_key_compare(__x._M_key_compare)
>>	  { }
>>
>>-#if __cplusplus >= 201103L
>>+#if __cplusplus < 201103L
>>+	  _Rb_tree_impl(const _Key_compare& __comp, const _Node_allocator& __a)
>>+	  : _Node_allocator(__a), _Base_key_compare(__comp)
>>+	  { }
>>+#else
>>	  _Rb_tree_impl(_Rb_tree_impl&&) = default;

Please also add a blank line here, between these two constructors.

>>	  _Rb_tree_impl(const _Key_compare& __comp, _Node_allocator&& __a)
>>	  : _Node_allocator(std::move(__a)), _Base_key_compare(__comp)
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: _Rb_tree regression
  2016-12-14 11:29 ` Jonathan Wakely
  2016-12-14 11:36   ` Jonathan Wakely
@ 2016-12-14 11:54   ` Jonathan Wakely
  2016-12-14 21:39     ` François Dumont
  1 sibling, 1 reply; 5+ messages in thread
From: Jonathan Wakely @ 2016-12-14 11:54 UTC (permalink / raw)
  To: François Dumont; +Cc: libstdc++, gcc-patches, Christophe MONAT

On 14/12/16 11:27 +0000, Jonathan Wakely wrote:
>On 13/12/16 22:51 +0100, François Dumont wrote:
>>Hi
>>
>>   I have been reported privately by Christophe in copy a regression 
>>resulting from my recent changes to _Rb_tree. I removed a 
>>constructor still necessary in C++03 mode or before. Tests would 
>>have shown it if I had run them in C++03.
>
>For reference:
>
> make check RUNTESTFLAGS=--target_board=unix/-std=gnu++03
>
>On trunk this will run almost the entire testsuite as C++03.
>
>>   * include/bits/stl_tree.h
>>   (_Rb_tree_impl(const _Key_compare&, const _Node_allocator&): Restore
>>   before C++11 mode.
>>
>>   I prefer to restore it only before C++11 while it used to be 
>>available in any mode. It is only call with rvalue references. Don't
>
>It's only called with *rvalues* (not rvalue references) but for C++11
>and up we have a constructor taking an rvalue reference, so I agree
>that the constructor taking a const lvalue reference is only needed
>for C++03.
>
>>hesitate to commit it yourself if you prefer to fix it quickly 
>>otherwise I'll do it after validation in about 24 hours.
>
>OK, thanks, please commit as soon as testing completes.

I've confirmed that the change fixes these bad test results for C++03
testing:

UNRESOLVED:     12
FAIL:   32


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: _Rb_tree regression
  2016-12-14 11:54   ` Jonathan Wakely
@ 2016-12-14 21:39     ` François Dumont
  0 siblings, 0 replies; 5+ messages in thread
From: François Dumont @ 2016-12-14 21:39 UTC (permalink / raw)
  To: Jonathan Wakely; +Cc: libstdc++, gcc-patches, Christophe MONAT


On 14/12/2016 12:36, Jonathan Wakely wrote:
> On 14/12/16 11:27 +0000, Jonathan Wakely wrote:
>> On 13/12/16 22:51 +0100, François Dumont wrote:
> I've confirmed that the change fixes these bad test results for C++03
> testing:
>
> UNRESOLVED:     12
> FAIL:   32
>

Thanks for confirming, now committed.

François

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-12-14 20:51 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-13 21:51 _Rb_tree regression François Dumont
2016-12-14 11:29 ` Jonathan Wakely
2016-12-14 11:36   ` Jonathan Wakely
2016-12-14 11:54   ` Jonathan Wakely
2016-12-14 21:39     ` François Dumont

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).