From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7340 invoked by alias); 24 Feb 2010 14:17:42 -0000 Received: (qmail 7194 invoked by uid 48); 24 Feb 2010 14:17:29 -0000 Date: Wed, 24 Feb 2010 14:17:00 -0000 Message-ID: <20100224141729.7193.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug other/42540] c++ error message [vtable undefined] is unhelpful In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "rearnsha at gcc dot gnu dot org" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2010-02/txt/msg02461.txt.bz2 ------- Comment #5 from rearnsha at gcc dot gnu dot org 2010-02-24 14:17 ------- As suggested, there's no bug in the compiler here, and the error message comes from the linker. The linker doesn't know what the key function is, so I doubt it could issue a more accurate diagnostic. In fact, the key function is just a trigger to the compiler to cause it to emit the meta-data for the class exactly once -- and because there the class could be used in multiple compilation units it can never know which one should contain the meta data as any of them could have done. As far as the linker is concerned, there really is no class for A; it's the same as if there was no definition for a global extern variable. -- rearnsha at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution| |INVALID http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42540