PATCH: Add missing typename keyword

Loren James Rittle rittle@latour.rsch.comm.mot.com
Thu Nov 16 00:25:00 GMT 2000


BTW, this is in a code path not seen on every platform (esp. Linux)
but it causes 11 ICEs during 'make check-g++' on affected platforms.

If anyone is interested, after the patch is a short test case that
only triggers the ICE when compiled with 'g++ -pedantic-errors'.

2000-11-16  Loren J. Rittle  <ljrittle@acm.org>

	* include/bits/locale_facets.tcc (num_get<_CharT,
          _InIter>::do_get(...)): Add missing typename keyword.

Index: libstdc++-v3/include/bits/locale_facets.tcc
===================================================================
RCS file: /cvs/gcc/egcs/libstdc++-v3/include/bits/locale_facets.tcc,v
retrieving revision 1.3
diff -c -r1.3 locale_facets.tcc
*** locale_facets.tcc	2000/10/25 16:54:47	1.3
--- locale_facets.tcc	2000/11/16 07:55:54
***************
*** 684,690 ****
        long double __ld;
        int __p = sscanf(__xtrc, __conv, &__ld);
        if (__p
!           && static_cast<__traits_type::int_type>(__p) != __traits_type::eof())
          __v = __ld;
        else
          __err |= ios_base::failbit;
--- 684,691 ----
        long double __ld;
        int __p = sscanf(__xtrc, __conv, &__ld);
        if (__p
!           && static_cast<typename __traits_type::int_type>(__p)
! 	  != __traits_type::eof())
          __v = __ld;
        else
          __err |= ios_base::failbit;

// Test for handling of missing typename keyword - ljr
// Build don't link: 
// Special Options: -pedantic-errors
template<class _CharT>
struct char_traits
{
  typedef unsigned long int_type;
};

template<typename _CharT>
class bar
{
  typedef char_traits<_CharT> __traits_type;

public:
  int foo ()
  {
    int __p = 1;
    if (static_cast<__traits_type::int_type>(__p))
      return 1;
    return 0;
  }
};


More information about the Libstdc++ mailing list