mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-01-28 11:04:04 +08:00
explicit72.C: ensure that char and (un)signed char are different types for template...
* g++.old-deja/g++.pt/explicit72.C: ensure that char and (un)signed char are different types for template specialization purposes. From-SVN: r22226
This commit is contained in:
parent
ec066414f0
commit
d559d91dfb
@ -1,3 +1,9 @@
|
||||
1998-09-04 Reid M. Pinchback <reidmp@MIT.EDU>, Alexandre Oliva <oliva@dcc.unicamp.br>
|
||||
|
||||
* g++.old-deja/g++.pt/explicit72.C: ensure that char and
|
||||
(un)signed char are different types for template specialization
|
||||
purposes.
|
||||
|
||||
Thu Sep 3 00:40:32 1998 Ovidiu Predescu <ovidiu@aracnet.com>
|
||||
|
||||
* lib/{objc.exp,objc-torture.exp}: New files for objc testing harness.
|
||||
|
21
gcc/testsuite/g++.old-deja/g++.pt/explicit72.C
Normal file
21
gcc/testsuite/g++.old-deja/g++.pt/explicit72.C
Normal file
@ -0,0 +1,21 @@
|
||||
// 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();
|
||||
}
|
Loading…
Reference in New Issue
Block a user