This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/11788] New: [3.4 regression] missing implicit instantiation of static member function
- From: "reichelt at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 4 Aug 2003 14:19:22 -0000
- Subject: [Bug c++/11788] New: [3.4 regression] missing implicit instantiation of static member function
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11788
Summary: [3.4 regression] missing implicit instantiation of
static member function
Product: gcc
Version: 3.4
Status: UNCONFIRMED
Keywords: wrong-code
Severity: critical
Priority: P1
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: reichelt at gcc dot gnu dot org
CC: gcc-bugs at gcc dot gnu dot org
Consider the following program:
------------------------------------------
template <typename> struct A
{
static void foo() {}
};
int main()
{
A<int> a;
return (int)(&a.foo);
}
------------------------------------------
Compiling this with mainline (since the parser merge) results
in a linker error:
/tmp/ccWTn0Bs.o: In function `main':
/tmp/ccWTn0Bs.o(.text+0x11): undefined reference to `A<int>::foo()'
If I instantiate A<int>::foo explicitly the code compiles.
But IMHO the explicit instantiation isn't mandated.