From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26039 invoked by alias); 19 Feb 2014 19:57:45 -0000 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 Received: (qmail 26010 invoked by uid 48); 19 Feb 2014 19:57:42 -0000 From: "ppluzhnikov at google dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/60277] New: Bogus "inline function virtual ..." used but never defined Date: Wed, 19 Feb 2014 19:57:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: unknown X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: ppluzhnikov at google dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter Message-ID: 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-SW-Source: 2014-02/txt/msg02016.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D60277 Bug ID: 60277 Summary: Bogus "inline function virtual ..." used but never defined Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: ppluzhnikov at google dot com Test case: struct Foo { inline virtual void func() =3D 0; }; struct Bar : public Foo { void func() { } }; int main() { Foo *f =3D new Bar; f->func(); } Using trunk: g++ (GCC) 4.9.0 20140219 (experimental) g++ -c -Wall -Wextra t.cc t.cc:2:23: warning: inline function 'virtual void Foo::func()' used but nev= er defined inline virtual void func() =3D 0; ^ But Foo::func is never actually used. Analysis by Nick Lewycky: The relevant [basic.odr]/2 text is: "A virtual member function is odr-used if it is not pure. A non-overloaded function whose name appears as a potentially-evaluated expression or a memb= er of a set of candidate functions, if selected by overload resolution when referred to from a potentially-evaluated expression, is odr-used, unless it= is a pure virtual function and its name is not explicitly qualified." Since the function isn't ODR-used, there's no need for it to have a definit= ion: "An inline function shall be de=EF=AC=81ned in every translation unit in = which it is odr-used." [basic.odr]/3 >>From gcc-bugs-return-444258-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Wed Feb 19 19:57:22 2014 Return-Path: Delivered-To: listarch-gcc-bugs@gcc.gnu.org Received: (qmail 25321 invoked by alias); 19 Feb 2014 19:57:21 -0000 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 Delivered-To: mailing list gcc-bugs@gcc.gnu.org Received: (qmail 25286 invoked by uid 48); 19 Feb 2014 19:57:18 -0000 From: "mark at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug debug/56563] no debuginfo for "explicit" operator Date: Wed, 19 Feb 2014 19:57:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: debug X-Bugzilla-Version: unknown X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: mark at gcc dot gnu.org X-Bugzilla-Status: RESOLVED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_status resolution Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-02/txt/msg02015.txt.bz2 Content-length: 986 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56563 Mark Wielaard changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution|--- |FIXED --- Comment #4 from Mark Wielaard --- With the patch we get the following for the example in the description: [ 37] subprogram external (flag_present) Yes name (strp) "operator int" decl_file (data1) 1 decl_line (data1) 3 linkage_name (strp) "_ZN1qcviEv" type (ref4) [ 51] declaration (flag_present) Yes explicit (flag_present) Yes object_pointer (ref4) [ 4a]