]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/testsuite/g++.old-deja/g++.pt/explicit72.C
explicit72.C: ensure that char and (un)signed char are different types for template...
[thirdparty/gcc.git] / gcc / testsuite / g++.old-deja / g++.pt / explicit72.C
1 // Build don't link:
2 // Contributed by Reid M. Pinchback <reidmp@MIT.EDU>
3 // Adapted by Alexandre Oliva <oliva@dcc.unicamp.br>
4 // plain char, signed char and unsigned char are distinct types
5
6 template <class X, class Y> class bug {};
7 template <class X> class bug<X,char> { typedef char t; };
8 template <class X> class bug<X,unsigned char> { typedef unsigned char t; };
9 template <class X> class bug<X,signed char> { typedef signed char t; };
10 template <class X> class bug<char,X> { typedef char t; };
11 template <class X> class bug<unsigned char,X> { typedef unsigned char t; };
12 template <class X> class bug<signed char,X> { typedef signed char t; };
13
14 void foo() {
15 bug<int,char>::t();
16 bug<int,signed char>::t();
17 bug<int,unsigned char>::t();
18 bug<char,int>::t();
19 bug<signed char,int>::t();
20 bug<unsigned char,int>::t();
21 }