c++/8858: Gcc "rebinds" template member names.
bangerth@dealii.org
bangerth@dealii.org
Mon Dec 9 11:29:00 GMT 2002
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
More information about the Gcc-prs
mailing list