This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/24588] Fails to identify template using local classes
- From: "igodard at pacbell dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 30 Oct 2005 21:29:13 -0000
- Subject: [Bug c++/24588] Fails to identify template using local classes
- References: <bug-24588-6594@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #2 from igodard at pacbell dot net 2005-10-30 21:29 -------
I don't get it. The argument is A<int>::iterator, which surely depends on
A<E>::iterator (with "E" taken as "int"). The problem also arises in the
simpler case:
#include <iostream>
template<typename E>
class A {
public:
class iterator {
E dummy;
};
iterator iter;
};
template< typename E>
void sort( typename E::iterator& first, typename E::iterator& last ) {
std::cout << "sort" << std::endl;
}
int main( int argc, char *argv[] ) {
A<int> first, last;
sort(first.iter,last.iter);
return 0;
}
It looks to me that unification is not looking at the qualifier of a qualified
type. This may be what the standard says (it's a mystery to me) but is sure
surprising.
Ivan
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24588