I cannot reproduce the error without std.

I wrote an small testcase, wich one I include to make clear the situation.

The code:

#include <list>

template<class T>
class Test
        typedef std::list<T> ListAlias;
        ListAlias list;
        typedef typename ListAlias::const_iterator const_iterator;
        inline const_iterator begin() const;


template<class T>
inline typename std::list<T>::const_iterator Test<T>::begin() const
    return list.begin();

The error:

test.cpp:16:46: error: prototype for 'typename std::list<T>::const_iterator
Test<T>::begin() const' does not match any in class 'Test<T>'
test.cpp:11:31: error: candidate is: Test<T>::const_iterator Test<T>::begin()

The ii file is really long with the include header, and I think that the
testcase is small.

           Summary: match a method prototyped a typedef alias with the
                    original type (using stdlib)
           Product: gcc
           Version: 4.5.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: hugo dot arregui at gmail dot com
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


Reply via email to