This is the mail archive of the gcc-bugs@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]

not supported by dump decl?


While compiling the following file the compiler emits the message:
sorry, not implemented: `reference_type' not supported by dump_decl.
The first definition of the function rev is taken from the file
reverseBidirectionalIterator.html of SGIs STL homepage, so I thought
the function should compile.
The second version of rev by me works, though.

Is this behaviour a compiler bug or has the standard changed?

Peter Schmid

cat rbi.C
#include<iostream>
#include<list>

#if 1
template <class T>
void rev(const list<T>& L)
{
   typedef reverse_bidirectional_iterator<list<T>::iterator,
                                          T,
                                          list<T>::reference_type,
                                          list<T>::difference_type>
           reverse_iterator; 
   reverse_iterator rfirst(L.end());
   reverse_iterator rlast(L.begin());

   while (rfirst != rlast)
      cout << *rfirst++ << endl;
}
#else
template <class T>
void rev(const list<T>& L)
{
   list<T>::const_reverse_iterator rfirst(L.end());
   list<T>::const_reverse_iterator rlast(L.begin());

   while (rfirst != rlast)
      cout << *rfirst++ << endl;
 }

#endif

int array [] = { 1, 5, 2, 3 };

int main ()
{
    list<int> v (array, array + 4);
    rev(v);
}

g++ -v rbi.C
Reading specs from /usr/local/lib/gcc-lib/i586-pc-linux-gnulibc1/egcs-2.91.03/specs
gcc version egcs-2.91.03 971225 (gcc-2.8.0)
 /usr/local/lib/gcc-lib/i586-pc-linux-gnulibc1/egcs-2.91.03/cpp -lang-c++ -v -undef -D__GNUC__=2 -D__GNUG__=2 -D__cplusplus -D__GNUC_MINOR__=91 -D__ELF__ -Dunix -Dlinux -D__ELF__ -D__unix__ -D__linux__ -D__unix -D__linux -Asystem(posix) -D__EXCEPTIONS -Di
386 -Di586 -Asystem(unix) -Acpu(i386) -Amachine(i386) -D__i386__ -D__i586__ -Asystem(unix) -Acpu(i386) -Amachine(i386) rbi.C /tmp/cca25479.ii
GNU CPP version egcs-2.91.03 971225 (gcc-2.8.0) (i386 Linux/ELF)
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/include/g++
 /usr/local/include
 /usr/local/i586-pc-linux-gnulibc1/include
 /usr/local/lib/gcc-lib/i586-pc-linux-gnulibc1/egcs-2.91.03/include
 /usr/include
End of search list.
 /usr/local/lib/gcc-lib/i586-pc-linux-gnulibc1/egcs-2.91.03/cc1plus /tmp/cca25479.ii -quiet -dumpbase rbi.cc -version -o /tmp/cca25479.s
GNU C++ version egcs-2.91.03 971225 (gcc-2.8.0) (i586-pc-linux-gnulibc1) compiled by GNU C version egcs-2.91.03 971225 (gcc-2.8.0).
rbi.C:21: sorry, not implemented: `reference_type' not supported by dump_decl
rbi.C:21: sorry, not implemented: `integer_type' not supported by dump_decl
rbi.C: In function `void rev(class list<T,__default_alloc_template<false,0> > &)':
rbi.C:21: type/value mismatch at argument 2 in template parameter list for `template <class BidirectionalIterator, class T, class Reference = , class Distance = > reverse_bidirectional_iterator<BidirectionalIterator,T,Reference,Distance>'
rbi.C:21:   expected a type, got `list<T,__default_alloc_template<false,0> >::reference_type'
rbi.C:22: warning: ANSI C++ forbids typedef which does not specify a type
rbi.C: In function `void rev<int>(class list<int,__default_alloc_template<false,0> > &)':
rbi.C:22: warning: ANSI C++ forbids typedef which does not specify a type
rbi.C:23: `struct __list_iterator<int,int &,int *>' used where a `int' was expected
rbi.C:24: `struct __list_iterator<int,int &,int *>' used where a `int' was expected
rbi.C:27: invalid type argument of `unary *'






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