This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: c++/8858: Gcc "rebinds" template member names.
- From: bangerth at dealii dot org
- To: eivuokko at bonumit dot com, gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, nobody at gcc dot gnu dot org
- Date: 9 Dec 2002 19:29:53 -0000
- Subject: Re: c++/8858: Gcc "rebinds" template member names.
- Reply-to: bangerth at dealii dot org, eivuokko at bonumit dot com, gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, nobody at gcc dot gnu dot org, gcc-gnats at gcc dot gnu dot org
Synopsis: Gcc "rebinds" template member names.
State-Changed-From-To: open->analyzed
State-Changed-By: bangerth
State-Changed-When: Mon Dec 9 11:29:52 2002
State-Changed-Why:
Confirmed. Very wicked template magic, though.
Here's a slightly smaller testcase, failing in the wrong
place:
----------------------------------#include <cassert>
template<class T_, class U_> struct cons {};
template<class L_> struct list {
typedef L_ type;
template<class T_> class add : public ::list< ::cons<T_, L_> > {};
};
template<class T1_,class T2_> struct IsSame { enum { Value = false }; };
template<class T_> struct IsSame<T_,T_> { enum { Value = true } ; };
int main() {
typedef list<cons<double,float> >::add<char>::add<int>::type test_type;
// this should absolutely fail
assert((IsSame<cons<int, cons<double,float> >,
test_type>::Value ));
// and this shouldn't
assert(( IsSame<
cons<int, cons<char, cons<double,float> > >,
test_type>::Value ));
}
------------------------------
This never went right, at least not back to 2.95.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=8858