Bug 9459 - typeof in return type specification of template not supported
typeof in return type specification of template not supported
Status: RESOLVED FIXED
Product: gcc
Classification: Unclassified
Component: c++
unknown
: P3 normal
: ---
Assigned To: Kriang Lerdsuwanakij
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2003-01-27 16:36 UTC by Wolfgang Bangerth
Modified: 2003-07-25 17:33 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Wolfgang Bangerth 2003-01-27 16:36:00 UTC
This has never worked in C++ (2.95 ICEs, more recent version
just fail, see below):
----------------------------
void foo (int) {}
void foo (double) {}


template <typename C>
typeof(foo(1))
bar () { return foo(1); }
----------------------------

g/a> /home/bangerth/bin/gcc-3.4-pre/bin/c++ -c bug34-4.cc
bug34-4.cc:7: sorry, unimplemented: `typeof_type' not supported by
   dump_type_prefix
bug34-4.cc:7: sorry, unimplemented: `typeof_type' not supported by
   dump_type_suffix


While typeof is a gcc extension, it is a very valuable
one, and in this particular instance, cannot even be
replaced by template magic, as far as I know...

W.

Release:
unknown

Environment:
all versions of gcc until present 3.4 CVS
Comment 1 Wolfgang Bangerth 2003-02-01 21:38:50 UTC
State-Changed-From-To: open->analyzed
State-Changed-Why: Still an issue.
Comment 2 Kriang Lerdsuwanakij 2003-02-16 15:37:43 UTC
Responsible-Changed-From-To: unassigned->lerdsuwa
Responsible-Changed-Why: Working on a fix.
Comment 3 Kriang Lerdsuwanakij 2003-02-16 17:04:27 UTC
From: lerdsuwa@gcc.gnu.org
To: gcc-gnats@gcc.gnu.org
Cc:  
Subject: c++/9459
Date: 16 Feb 2003 17:04:27 -0000

 CVSROOT:	/cvs/gcc
 Module name:	gcc
 Changes by:	lerdsuwa@gcc.gnu.org	2003-02-16 17:04:27
 
 Modified files:
 	gcc/cp         : ChangeLog error.c 
 	gcc/testsuite  : ChangeLog 
 Added files:
 	gcc/testsuite/g++.dg/ext: typeof4.C 
 
 Log message:
 	PR c++/9459
 	* error.c (dump_type_prefix): Handle TYPEOF_TYPE.
 	(dump_type_suffix): Likewise.
 	
 	* g++.dg/ext/typeof4.C: New test.
 
 Patches:
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.3197&r2=1.3198
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/error.c.diff?cvsroot=gcc&r1=1.198&r2=1.199
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.2413&r2=1.2414
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/ext/typeof4.C.diff?cvsroot=gcc&r1=NONE&r2=1.1
 
Comment 4 Kriang Lerdsuwanakij 2003-02-16 17:51:53 UTC
State-Changed-From-To: analyzed->closed
State-Changed-Why: Fixed
Comment 5 Kriang Lerdsuwanakij 2003-02-18 14:27:44 UTC
From: lerdsuwa@gcc.gnu.org
To: gcc-gnats@gcc.gnu.org
Cc:  
Subject: c++/9459
Date: 18 Feb 2003 14:27:44 -0000

 CVSROOT:	/cvs/gcc
 Module name:	gcc
 Branch: 	gcc-3_3-branch
 Changes by:	lerdsuwa@gcc.gnu.org	2003-02-18 14:27:44
 
 Modified files:
 	gcc/cp         : ChangeLog error.c 
 	gcc/testsuite  : ChangeLog 
 Added files:
 	gcc/testsuite/g++.dg/ext: typeof4.C 
 
 Log message:
 	PR c++/9459
 	* error.c (dump_type_prefix): Handle TYPEOF_TYPE.
 	(dump_type_suffix): Likewise.
 	
 	* g++.dg/ext/typeof4.C: New test.
 
 Patches:
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.3076.2.35&r2=1.3076.2.36
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/error.c.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.192.2.2&r2=1.192.2.3
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.2261.2.47&r2=1.2261.2.48
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/ext/typeof4.C.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=NONE&r2=1.1.2.1
 

Comment 6 Kriang Lerdsuwanakij 2003-02-19 15:28:31 UTC
From: lerdsuwa@gcc.gnu.org
To: gcc-gnats@gcc.gnu.org
Cc:  
Subject: c++/9459
Date: 19 Feb 2003 15:28:31 -0000

 CVSROOT:	/cvs/gcc
 Module name:	gcc
 Branch: 	gcc-3_2-branch
 Changes by:	lerdsuwa@gcc.gnu.org	2003-02-19 15:28:31
 
 Modified files:
 	gcc/cp         : ChangeLog error.c 
 	gcc/testsuite  : ChangeLog 
 Added files:
 	gcc/testsuite/g++.dg/ext: typeof4.C 
 
 Log message:
 	PR c++/9459
 	* error.c (dump_type_prefix): Handle TYPEOF_TYPE.
 	(dump_type_suffix): Likewise.
 	
 	* g++.dg/ext/typeof4.C: New test.
 
 Patches:
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_2-branch&r1=1.2685.2.114.2.64&r2=1.2685.2.114.2.65
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/error.c.diff?cvsroot=gcc&only_with_tag=gcc-3_2-branch&r1=1.170.2.3.2.4&r2=1.170.2.3.2.5
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_2-branch&r1=1.1672.2.166.2.94&r2=1.1672.2.166.2.95
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/ext/typeof4.C.diff?cvsroot=gcc&only_with_tag=gcc-3_2-branch&r1=NONE&r2=1.1.4.1