Bug List: (This bug is not in your last search results)   Show last search results      Search page      Enter new bug
Bug#: 15285
Product:  
Component:  
Status: RESOLVED
Resolution: FIXED
Assigned To: Mark Mitchell <mark@codesourcery.com>
Host:
Reported against  
Priority:  
Severity:  
Target Milestone:  
 
 
Target:
Reporter: Robert Evans <revans@trlm.com>
Add CC:
CC:
Remove selected CCs
Build:
URL:
Summary:
Keywords:
Known to work:
Known to fail:

Attachment Description Type Created Size Actions
tf.C Testcase text/plain 2004-05-04 19:53 91 bytes Edit
15285.ii Testcase text/plain 2004-05-04 19:58 119 bytes Edit
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 15285 depends on: Show dependency tree
Show dependency graph
Bug 15285 blocks:

Additional Comments:






View Bug Activity   |   Format For Printing   |   Clone This Bug


Description:   Last confirmed: 2004-05-04 19:58 Opened: 2004-05-04 19:52
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.

***tf.C****************

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

template<typename T>
void bar()
{}

template<typename T>
void baz()
{
        foo(&bar<long>);
}

**********************

$ 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 From Robert Evans 2004-05-04 19:53 -------
Created an attachment (id=6222) [edit]
Testcase

------- Comment #2 From Robert Evans 2004-05-04 19:58 -------
Created an attachment (id=6223) [edit]
Testcase

------- Comment #3 From Andrew Pinski 2004-05-04 19:58 -------
Confirmed.

------- Comment #4 From Mark Mitchell 2004-05-22 19:42 -------
Working on a fix.

------- Comment #5 From CVS Commits 2004-05-22 21:44 -------
Subject: Bug 15285

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-3_4-branch
Changes by:	mmitchel@gcc.gnu.org	2004-05-22 21:43:59

Modified files:
	gcc/testsuite  : ChangeLog 
	gcc/cp         : ChangeLog pt.c 
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.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.3389.2.178&r2=1.3389.2.179
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.3892.2.101&r2=1.3892.2.102
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/pt.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.816.2.24&r2=1.816.2.25
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/non-dependent5.C.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=NONE&r2=1.1.2.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/non-dependent6.C.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=NONE&r2=1.1.2.1


------- Comment #6 From CVS Commits 2004-05-22 21:45 -------
Subject: Bug 15285

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	mmitchel@gcc.gnu.org	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.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.4051&r2=1.4052
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/pt.c.diff?cvsroot=gcc&r1=1.851&r2=1.852
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.3770&r2=1.3771
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/non-dependent5.C.diff?cvsroot=gcc&r1=1.1&r2=1.2
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/non-dependent6.C.diff?cvsroot=gcc&r1=1.1&r2=1.2


------- Comment #7 From Mark Mitchell 2004-05-22 21:47 -------
Fixed in GCC 3.4.1.

------- Comment #8 From Andrew Pinski 2004-05-26 04:22 -------
*** Bug 15658 has been marked as a duplicate of this bug. ***

Bug List: (This bug is not in your last search results)   Show last search results      Search page      Enter new bug