This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[C++ PATCH] Fix PR 9459


Hi

This patch adds TYPEOF_TYPE handling to dump_type_prefix/suffix
rather than displaying 'sorry, unimplemented ...' messages.
Tested on i686-pc-linux-gnu.  Commited to main trunk as obvious.

--Kriang


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-16  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>

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


diff -cprN gcc-main-save/gcc/cp/error.c gcc-main-new/gcc/cp/error.c
*** gcc-main-save/gcc/cp/error.c	Thu Jan 30 21:19:09 2003
--- gcc-main-new/gcc/cp/error.c	Sun Feb 16 22:41:53 2003
*************** dump_type_prefix (t, flags)
*** 687,692 ****
--- 687,693 ----
      case TYPENAME_TYPE:
      case COMPLEX_TYPE:
      case VECTOR_TYPE:
+     case TYPEOF_TYPE:
        dump_type (t, flags);
        padding = before;
        break;
*************** dump_type_suffix (t, flags)
*** 783,788 ****
--- 784,790 ----
      case TYPENAME_TYPE:
      case COMPLEX_TYPE:
      case VECTOR_TYPE:
+     case TYPEOF_TYPE:
        break;
  
      default:
diff -cprN gcc-main-save/gcc/testsuite/g++.dg/ext/typeof4.C gcc-main-new/gcc/testsuite/g++.dg/ext/typeof4.C
*** gcc-main-save/gcc/testsuite/g++.dg/ext/typeof4.C	Thu Jan  1 07:00:00 1970
--- gcc-main-new/gcc/testsuite/g++.dg/ext/typeof4.C	Sun Feb 16 23:08:51 2003
***************
*** 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); }


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]