This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/34846] [4.3 regression] ICE on STL container iterator copy
- From: "ian at airs dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 18 Jan 2008 06:11:30 -0000
- Subject: [Bug c++/34846] [4.3 regression] ICE on STL container iterator copy
- References: <bug-34846-14703@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #1 from ian at airs dot com 2008-01-18 06:11 -------
Here is a standalone test case.
template<typename, typename> struct __are_same { enum { __value = 0 }; };
template<typename _Tp> struct __are_same<_Tp, _Tp> { enum { __value = 1 }; };
template<typename, bool> struct __enable_if { };
template<typename _Tp> struct __enable_if<_Tp, true> { typedef _Tp __type; };
template<typename _Iterator, typename _Container> class __normal_iterator {
public:
__normal_iterator();
template<typename _Iter>
__normal_iterator(
const __normal_iterator<_Iter, typename __enable_if<_Container,
(__are_same<_Iter, typename _Container::pointer>::__value) >::__type>& __i)
{ }
};
template<typename _Tp> class vector {
public:
typedef _Tp* pointer;
typedef __normal_iterator<int, vector<_Tp> > iterator;
};
void test() {
typedef int t;
vector<t*>::iterator x;
vector<t*>::iterator y = x;
}
--
ian at airs dot com changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |ice-on-valid-code
Summary|ICE on STL container |[4.3 regression] ICE on STL
|iterator copy |container iterator copy
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34846