User account creation filtered due to spam.

Bug 15285 - [3.4/4.0 regression] instantiate_type ICE when forming pointer to template function
Summary: [3.4/4.0 regression] instantiate_type ICE when forming pointer to template fu...
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 3.4.0
: P2 critical
Target Milestone: 3.4.1
Assignee: Mark Mitchell
Keywords: ice-on-valid-code
: 15658 (view as bug list)
Depends on:
Reported: 2004-05-04 19:52 UTC by Robert Evans
Modified: 2004-10-30 21:11 UTC (History)
2 users (show)

See Also:
Host: i686-pc-linux-gnu
Known to work: 3.3.3
Known to fail: 3.4.0 4.0.0
Last reconfirmed: 2004-05-04 19:58:48

Testcase (91 bytes, text/plain)
2004-05-04 19:53 UTC, Robert Evans
Testcase (119 bytes, text/plain)
2004-05-04 19:58 UTC, Robert Evans

Note You need to log in before you can comment on or make changes to this bug.
Description Robert Evans 2004-05-04 19:52:02 UTC
The compiler throws an ICE when trying to form a pointer to an instance of a
template function from within a different template function.  This worked in
gcc-3.3.3 and is also broken in the mainline.


void foo(void (*func)()) {}

template<typename T>
void bar()

template<typename T>
void baz()


$ g++ tf.C
tf.C: In member function `void Class<Type>::foo(Object*)':
tf.C:18: internal compiler error: in instantiate_type, at cp/class.c:6164

$ g++ -v
Reading specs from /home/bob/bin/gcc-3.4/lib/gcc/i686-pc-linux-gnu/3.4.0/specs
Configured with: ../gcc/configure --enable-threads=posix
--enable-languages=c,c++ --prefix=/home/bob/bin/gcc-3.4
Thread model: posix
gcc version 3.4.0
Comment 1 Robert Evans 2004-05-04 19:53:51 UTC
Created attachment 6222 [details]
Comment 2 Robert Evans 2004-05-04 19:58:35 UTC
Created attachment 6223 [details]
Comment 3 Andrew Pinski 2004-05-04 19:58:48 UTC
Comment 4 Mark Mitchell 2004-05-22 19:42:02 UTC
Working on a fix.
Comment 6 CVS Commits 2004-05-22 21:45:33 UTC
Subject: Bug 15285

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	2004-05-22 21:45:25

Modified files:
	gcc/cp         : ChangeLog pt.c 
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/g++.dg/template: non-dependent5.C non-dependent6.C 

Log message:
	PR c++/15285
	PR c++/15299
	* pt.c (build_non_dependent_expr): Expand the set of tree nodes
	recognized as overloaded functions.
	PR c++/15285
	PR c++/15299
	* g++.dg/template/non-dependent5.C: New test.
	* g++.dg/template/non-dependent6.C: New test.


Comment 7 Mark Mitchell 2004-05-22 21:47:07 UTC
Fixed in GCC 3.4.1.
Comment 8 Andrew Pinski 2004-05-26 04:22:45 UTC
*** Bug 15658 has been marked as a duplicate of this bug. ***