aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorReid M. Pinchback <reidmp@MIT.EDU>1998-09-03 22:30:30 +0000
committerAlexandre Oliva <oliva@gcc.gnu.org>1998-09-03 22:30:30 +0000
commitd559d91dfb31635043925860b67c1e243a71ad13 (patch)
tree7167b834513c7b52496e502f57e04954471f7549
parentec066414f096d61dc99440804958dfac2645137b (diff)
downloadgcc-d559d91dfb31635043925860b67c1e243a71ad13.zip
gcc-d559d91dfb31635043925860b67c1e243a71ad13.tar.gz
gcc-d559d91dfb31635043925860b67c1e243a71ad13.tar.bz2
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
-rw-r--r--gcc/testsuite/ChangeLog6
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/explicit72.C21
2 files changed, 27 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 6d278b3..47a6f50 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -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.
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/explicit72.C b/gcc/testsuite/g++.old-deja/g++.pt/explicit72.C
new file mode 100644
index 0000000..bc9edfb
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.pt/explicit72.C
@@ -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();
+}