19980824 partial specialization bug with char/signed char
Alexandre Oliva
oliva@dcc.unicamp.br
Tue Sep 1 20:38:00 GMT 1998
Reid M Pinchback <reidmp@MIT.EDU> writes:
> Using the 19980824 snapshot on an alpha-dec-osf4.0d I ran
> into another template specialization bug. In my case it
> appeared in char vs signed char partial specializations.
Now you've found a real bug.
Jason, may I install the attached testcase?
--
Alexandre Oliva
mailto:oliva@dcc.unicamp.br mailto:aoliva@acm.org
http://www.dcc.unicamp.br/~oliva
Universidade Estadual de Campinas, SP, Brasil
-------------- next part --------------
// Build don't link:
// Contributed by Reid M. Pinchback <reidmp@MIT.EDU>
// Adapted by Alexandre Oliva <oliva@dcc.unicamp.br>
// plain char, signed char and unsigned char are distinct types
template <class X, class Y> class bug {};
template <class X> class bug<X,char> { typedef char t; };
template <class X> class bug<X,unsigned char> { typedef unsigned char t; };
template <class X> class bug<X,signed char> { typedef signed char t; };
template <class X> class bug<char,X> { typedef char t; };
template <class X> class bug<unsigned char,X> { typedef unsigned char t; };
template <class X> class bug<signed char,X> { typedef signed char t; };
void foo() {
bug<int,char>::t();
bug<int,signed char>::t();
bug<int,unsigned char>::t();
bug<char,int>::t();
bug<signed char,int>::t();
bug<unsigned char,int>::t();
}
More information about the Gcc-bugs
mailing list