re PR c++/9459 (typeof in return type specification of template not supported)
authorKriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
Sun, 16 Feb 2003 17:04:27 +0000 (17:04 +0000)
committerKriang Lerdsuwanakij <lerdsuwa@gcc.gnu.org>
Sun, 16 Feb 2003 17:04:27 +0000 (17:04 +0000)
PR c++/9459
* error.c (dump_type_prefix): Handle TYPEOF_TYPE.
(dump_type_suffix): Likewise.

* g++.dg/ext/typeof4.C: New test.

From-SVN: r62973

gcc/cp/ChangeLog
gcc/cp/error.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/ext/typeof4.C [new file with mode: 0644]

index 2ddc227941e34c90bc9c10a7a5e5c7afb01b5309..85bc0e46c6bb7ba1032f14624a8177fba79413f1 100644 (file)
@@ -1,3 +1,9 @@
+2003-02-16  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
+
+       PR c++/9459
+       * error.c (dump_type_prefix): Handle TYPEOF_TYPE.
+       (dump_type_suffix): Likewise.
+
 2003-02-14  Nathan Sidwell  <nathan@codesourcery.com>
 
        * search.c: ANSIfy function declarations and definitions.
index 9fe4167483e8d3da28ebfba122fd8f23268fb2d9..5938057706deaca8683d6a1486e0dafe19ebd0d3 100644 (file)
@@ -687,6 +687,7 @@ dump_type_prefix (t, flags)
     case TYPENAME_TYPE:
     case COMPLEX_TYPE:
     case VECTOR_TYPE:
+    case TYPEOF_TYPE:
       dump_type (t, flags);
       padding = before;
       break;
@@ -783,6 +784,7 @@ dump_type_suffix (t, flags)
     case TYPENAME_TYPE:
     case COMPLEX_TYPE:
     case VECTOR_TYPE:
+    case TYPEOF_TYPE:
       break;
 
     default:
index 18044bbf1b69ddbf48786d497a082ceaf158b482..39436e8d9eecc81cd21b1b0431ea1f98c1ca3b14 100644 (file)
@@ -1,3 +1,8 @@
+2003-02-16  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
+
+       PR c++/9459
+       * g++.dg/ext/typeof4.C: New test.
+
 2003-02-15  Roger Sayle  <roger@eyesopen.com>
 
        * gcc.dg/i386-387-3.c: New test case.
diff --git a/gcc/testsuite/g++.dg/ext/typeof4.C b/gcc/testsuite/g++.dg/ext/typeof4.C
new file mode 100644 (file)
index 0000000..2f42370
--- /dev/null
@@ -0,0 +1,13 @@
+// { dg-do compile }
+// { dg-options "" }
+
+// Origin: Wolfgang Bangerth <bangerth@ticam.utexas.edu>
+
+// PR c++/9459: typeof in return type of template function
+
+void foo (int) {}
+void foo (double) {}
+
+template <typename C>
+typeof(foo(1))
+bar () { return foo(1); }