public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* c++/5436: explicit instatiation
@ 2002-01-20 7:26 kunert
0 siblings, 0 replies; 2+ messages in thread
From: kunert @ 2002-01-20 7:26 UTC (permalink / raw)
To: gcc-gnats
>Number: 5436
>Category: c++
>Synopsis: explicit instatiation
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: rejects-legal
>Submitter-Id: net
>Arrival-Date: Sun Jan 20 07:26:01 PST 2002
>Closed-Date:
>Last-Modified:
>Originator: Thomas Kunert
>Release: 3.0.2, cvs 15.1.02
>Organization:
>Environment:
i586-pc-linux-gnu
>Description:
This code:
template <class T>
class A {
static const int a=17; // #1
A( const A& ); // #2
};
extern template class A<int>;
template class A<int>;
generates the error messages:
test.cc: In instantiation of `A<T>::A(const A<T>&) [with T = int]':
test.cc:8: instantiated from here
test.cc:8: explicit instantiation of `A<T>::A(const A<T>&) [with T = int]' but
no definition available
test.cc: In instantiation of `const int A<int>::a':
test.cc:8: instantiated from here
test.cc:8: explicit instantiation of `A<int>::a' but no definition available
Without the `extern' declaration this error message disappears.
Line #1 is definitely legal and the corresponding
error message is wrong.
I am not sure about #2, but it seems inconsistent that
the legality of this depends on the extern declaration.
Thomas Kunert
>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: c++/5436: explicit instatiation
@ 2002-09-15 12:21 nathan
0 siblings, 0 replies; 2+ messages in thread
From: nathan @ 2002-09-15 12:21 UTC (permalink / raw)
To: gcc-bugs, gcc-prs, kunert, nobody
Synopsis: explicit instatiation
State-Changed-From-To: open->analyzed
State-Changed-By: nathan
State-Changed-When: Sun Sep 15 12:21:39 2002
State-Changed-Why:
extern template is a g++ extension.
definitely a bug. regardless of the extern template bit,
the explicit instantiation should barf
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=5436
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2002-09-15 19:21 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-01-20 7:26 c++/5436: explicit instatiation kunert
2002-09-15 12:21 nathan
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).