From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id D0C2D3858D28; Mon, 14 Mar 2022 17:22:33 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D0C2D3858D28 From: "redi at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug other/42540] c++ error message [vtable undefined] is unhelpful Date: Mon, 14 Mar 2022 17:22:33 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: other X-Bugzilla-Version: 4.5.0 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: enhancement X-Bugzilla-Who: redi at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: jyasskin at gmail dot com X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Mar 2022 17:22:33 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D42540 --- Comment #18 from Jonathan Wakely --- (In reply to Eyal Rozenberg from comment #16) > The compiler could store information in the compiled object listing the > virtual members for which no implementation was found, due to which reason > the vtable was not defined already. In this specific example, storing the > name of "A::B()" somewhere. In every file that includes the header defining A? Consider the case where you include the header in ten files, and define the virtual functions in one of them. Nine out of ten files do not contain a definitions of the virtual functions, so they would each contain the same i= nfo naming every virtual function in the class. Then do that for every polymorp= hic class in every object file. This is a lot more info being written out, and = most of it will never be used. You have nine files saying "this function is missing" and one not saying it. What exactly does the linker do with that information? Why would that be be= tter than comment 7 here?=