https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80183

Markus Trippelsdorf <trippels at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |7.0

--- Comment #3 from Markus Trippelsdorf <trippels at gcc dot gnu.org> ---
The problem is here libstdc++-v3/include/bits/stl_tree.h:


 179 #if __cplusplus >= 201103L                                                 
 180     _Rb_tree_header(_Rb_tree_header&& __x) noexcept                        
 181     {                                                                      
 182       if (__x._M_header._M_parent != nullptr)                              
 183         _M_move_data(__x);                                                 
 184       else                                                                 
 185         {                                                                  
 186           _M_header._M_color = _S_red;                                     
 187           _M_reset();                                                      
 188         }                                                                  
 189     }                                                                      
 190 #endif                                                                     
 191                                                                            
 192     void                                                                   
 193     _M_move_data(_Rb_tree_header& __from)                                  
 194     {                                                                      
 195       _M_header._M_parent = __from._M_header._M_parent;                    
 196       _M_header._M_left = __from._M_header._M_left;                        
 197       _M_header._M_right = __from._M_header._M_right;                      
 198       _M_header._M_parent->_M_parent = &_M_header;                         
 199       _M_node_count = __from._M_node_count;                                
 200                                                                            
 201       __from._M_reset();                                                   
 202     }                                                                      
 203                                                                            
 204     void                                                                   
 205     _M_reset()                                                             
 206     {                                                                      
 207       _M_header._M_parent = 0;                                             
 208       _M_header._M_left = &_M_header;                                      
 209       _M_header._M_right = &_M_header;                                     
 210       _M_node_count = 0;                                                   
 211     }                                                                      
 212   }; 

on line 183 _M_move_data(__x) doesn't set _M_header._M_color to any value.
So either hard set it to _S_red or augment _M_move_data to copy the color.

Reply via email to