From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4193 invoked by alias); 20 Jan 2002 15:26:01 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 4157 invoked by uid 71); 20 Jan 2002 15:26:01 -0000 Resent-Date: 20 Jan 2002 15:26:01 -0000 Resent-Message-ID: <20020120152601.4156.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-To: nobody@gcc.gnu.org Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org Resent-Reply-To: gcc-gnats@gcc.gnu.org, kunert@physik.tu-dresden.de Received:(qmail 4113 invoked by uid 61); 20 Jan 2002 15:25:50 -0000 Message-Id:<20020120152550.4112.qmail@sources.redhat.com> Date: Sun, 20 Jan 2002 07:26:00 -0000 From: kunert@physik.tu-dresden.de Reply-To: kunert@physik.tu-dresden.de To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version:gnatsweb-2.9.3 (1.1.1.1.2.31) Subject: c++/5436: explicit instatiation X-SW-Source: 2002-01/txt/msg00697.txt.bz2 List-Id: >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 A { static const int a=17; // #1 A( const A& ); // #2 }; extern template class A; template class A; generates the error messages: test.cc: In instantiation of `A::A(const A&) [with T = int]': test.cc:8: instantiated from here test.cc:8: explicit instantiation of `A::A(const A&) [with T = int]' but no definition available test.cc: In instantiation of `const int A::a': test.cc:8: instantiated from here test.cc:8: explicit instantiation of `A::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: