This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

PATCH: libstdc++/7922


I did quickly study how this problem was fixed over the years (even
though I have fixed similar myself a few times).  Since each point of
lookup occurs exactly once, I chose this fix verses the introduction
of 4 new mirror/forwarding typedefs (the other style which was used to
fix it in the library).  Tested on i386-unknown-freebsd4.6 (on
mainline in already bootstrapped tree and on 3.2.X branch by building
libstdc++-v3 against installed compiler) and by PR submitter in his
environment; applied to mainline and 3.2.X branch (since regression).

[ext/rope.cc actually finds the bug when testsuite run with -pedantic
 flag, thus no new test case deemed required IMHO.  Instead, we should
 consider enabling a pass of the library testsuite with that flag OR
 just encourage us developers to run with that flag every now and
 then.  For good measure, I will do so on mainline.]

	libstdc++/7922
	* include/ext/stl_rope.h (rope<>): Qualify dependent names
	with `typename'.

Index: libstdc++-v3/include/ext/stl_rope.h
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/include/ext/stl_rope.h,v
retrieving revision 1.17
diff -c -r1.17 stl_rope.h
*** libstdc++-v3/include/ext/stl_rope.h	2 Jul 2002 06:17:36 -0000	1.17
--- libstdc++-v3/include/ext/stl_rope.h	17 Sep 2002 01:19:46 -0000
***************
*** 1375,1381 ****
          static _RopeLeaf* _S_new_RopeLeaf(__GC_CONST _CharT *__s,
                                            size_t __size, allocator_type __a)
          {
!             _RopeLeaf* __space = _LAllocator(__a).allocate(1);
              return new(__space) _RopeLeaf(__s, __size, __a);
          }
  
--- 1375,1381 ----
          static _RopeLeaf* _S_new_RopeLeaf(__GC_CONST _CharT *__s,
                                            size_t __size, allocator_type __a)
          {
!             _RopeLeaf* __space = typename _Base::_LAllocator(__a).allocate(1);
              return new(__space) _RopeLeaf(__s, __size, __a);
          }
  
***************
*** 1383,1396 ****
                          _RopeRep* __left, _RopeRep* __right,
                          allocator_type __a)
          {
!             _RopeConcatenation* __space = _CAllocator(__a).allocate(1);
              return new(__space) _RopeConcatenation(__left, __right, __a);
          }
  
          static _RopeFunction* _S_new_RopeFunction(char_producer<_CharT>* __f,
                  size_t __size, bool __d, allocator_type __a)
          {
!             _RopeFunction* __space = _FAllocator(__a).allocate(1);
              return new(__space) _RopeFunction(__f, __size, __d, __a);
          }
  
--- 1383,1396 ----
                          _RopeRep* __left, _RopeRep* __right,
                          allocator_type __a)
          {
!             _RopeConcatenation* __space = typename _Base::_CAllocator(__a).allocate(1);
              return new(__space) _RopeConcatenation(__left, __right, __a);
          }
  
          static _RopeFunction* _S_new_RopeFunction(char_producer<_CharT>* __f,
                  size_t __size, bool __d, allocator_type __a)
          {
!             _RopeFunction* __space = typename _Base::_FAllocator(__a).allocate(1);
              return new(__space) _RopeFunction(__f, __size, __d, __a);
          }
  
***************
*** 1398,1404 ****
                  _Rope_RopeRep<_CharT,_Alloc>* __b, size_t __s,
                  size_t __l, allocator_type __a)
          {
!             _RopeSubstring* __space = _SAllocator(__a).allocate(1);
              return new(__space) _RopeSubstring(__b, __s, __l, __a);
          }
  
--- 1398,1404 ----
                  _Rope_RopeRep<_CharT,_Alloc>* __b, size_t __s,
                  size_t __l, allocator_type __a)
          {
!             _RopeSubstring* __space = typename _Base::_SAllocator(__a).allocate(1);
              return new(__space) _RopeSubstring(__b, __s, __l, __a);
          }
  


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]