public inbox for gcc-prs@sourceware.org help / color / mirror / Atom feed
From: kunert@physik.tu-dresden.de To: gcc-gnats@gcc.gnu.org Subject: c++/5436: explicit instatiation Date: Sun, 20 Jan 2002 07:26:00 -0000 [thread overview] Message-ID: <20020120152550.4112.qmail@sources.redhat.com> (raw) >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:
next reply other threads:[~2002-01-20 15:26 UTC|newest] Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top 2002-01-20 7:26 kunert [this message] 2002-09-15 12:21 nathan
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20020120152550.4112.qmail@sources.redhat.com \ --to=kunert@physik.tu-dresden.de \ --cc=gcc-gnats@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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).