From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2547 invoked by alias); 18 Feb 2002 16:16:12 -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 2459 invoked by uid 71); 18 Feb 2002 16:16:08 -0000 Resent-Date: 18 Feb 2002 16:16:08 -0000 Resent-Message-ID: <20020218161608.2457.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, peter_broadhurst@ml.com Received:(qmail 32051 invoked by uid 61); 18 Feb 2002 16:10:17 -0000 Message-Id:<20020218161017.32048.qmail@sources.redhat.com> Date: Mon, 18 Feb 2002 08:16:00 -0000 From: peter_broadhurst@ml.com Reply-To: peter_broadhurst@ml.com To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version:gnatsweb-2.9.3 (1.1.1.1.2.31) Subject: c++/5721: link errors when using typedef struct {...}A; X-SW-Source: 2002-02/txt/msg00432.txt.bz2 List-Id: >Number: 5721 >Category: c++ >Synopsis: link errors when using typedef struct {...}A; >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: sw-bug >Submitter-Id: net >Arrival-Date: Mon Feb 18 08:16:06 PST 2002 >Closed-Date: >Last-Modified: >Originator: peter_broadhurst@ml.com >Release: 3.0.3 >Organization: >Environment: sparc-sun-solaris2.6 i386-redhat-linux (redhat 7.1) >Description: The files below give a link time error (undefined symbol A::f()) when compiled and linked. If the definition of A::f() is moved to the same file where it is used, then the problem disappears. if "struct A { void f(void); }; " is used, then the problem disappears. nm indicates that a local-only definition of A::F() is placed in typedeflinkbug2.o. Works in gcc 2.8.1 ==> typedeflinkbug.h <== typedef struct { void f(void); } A; ==> typedeflinkbug1.cpp <== #include "typedeflinkbug.h" int main(int,char**) { A a; a.f(); return 0; } ==> typedeflinkbug2.cpp <== #include "typedeflinkbug.h" void A::f(void) { } >How-To-Repeat: >Fix: >Release-Note: >Audit-Trail: >Unformatted: