public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: c++/7934: [HP UX] definition of static member for template class missing in obj file
@ 2002-12-04 7:21 bangerth
0 siblings, 0 replies; 2+ messages in thread
From: bangerth @ 2002-12-04 7:21 UTC (permalink / raw)
To: gcc-bugs, gcc-prs, michael_gu, mkjyg, nobody
Old Synopsis: definition of static member for template class missing in obj file
New Synopsis: [HP UX] definition of static member for template class missing in obj file
State-Changed-From-To: feedback->open
State-Changed-By: bangerth
State-Changed-When: Wed Dec 4 07:21:13 2002
State-Changed-Why:
Reporter gave this example
----------------------
template <class T>
class A
{
public:
static T * instance;
};
template <class T>
T * A<T>::instance = 0;
int main()
{
A<int> cB;
cB.instance=(int*)1;
}
--------------------------
It is supposedly not working on this platform.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=7934
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: c++/7934: [HP UX] definition of static member for template class missing in obj file
@ 2002-12-04 13:57 danglin
0 siblings, 0 replies; 2+ messages in thread
From: danglin @ 2002-12-04 13:57 UTC (permalink / raw)
To: danglin, gcc-bugs, gcc-prs, michael_gu, mkjyg, nobody
Synopsis: [HP UX] definition of static member for template class missing in obj file
Responsible-Changed-From-To: unassigned->danglin
Responsible-Changed-By: danglin
Responsible-Changed-When: Wed Dec 4 13:57:17 2002
Responsible-Changed-Why:
Assigned.
State-Changed-From-To: open->closed
State-Changed-By: danglin
State-Changed-When: Wed Dec 4 13:57:17 2002
State-Changed-Why:
[HP-UX] 32-bit port doesn't support weak symbols and as a
result template classes require explicit instantiation.
The example will compile and run correctly if you add
template class A<int>;
For other examples, look at the instantiations in
libstdc++-v3/src/*-inst.cc.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=7934
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2002-12-04 21:57 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-12-04 7:21 c++/7934: [HP UX] definition of static member for template class missing in obj file bangerth
2002-12-04 13:57 danglin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).