This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/14241] New: ICE when returning template class where template argument is a template function
- From: "Duff at DIKU dot DK" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 22 Feb 2004 07:56:38 -0000
- Subject: [Bug c++/14241] New: ICE when returning template class where template argument is a template function
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
The following code:
============================
template <typename T> void f () { }
template <void(*F)()> struct B { };
template <typename T> B< f<int> > g (T) { return B< f<int> >(); }
int main (int argc, char const* argv[])
{
g(0);
return 0;
}
============================
If "B< f<int> >" is replaced with a typedef, the program compiles.
The problem exists with both gcc 2.x and 3.x and I have verified it under different distributions of linux
(and therefor gcc) plus Mac OS X (with apple's modified gcc).
The output from the compiler is:
In function `int main(int, const char**)':
internal compiler error: Bus error
(or segmentation fault on other systems)
--
Summary: ICE when returning template class where template
argument is a template function
Product: gcc
Version: 3.3.2
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: Duff at DIKU dot DK
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14241