From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id BC4DE3857BB8; Thu, 7 Mar 2024 13:22:58 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BC4DE3857BB8 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1709817778; bh=2KT+gV0qMuhdLFQgkfs2PIvDTugsOUiI7gvPA3mZBNg=; h=From:To:Subject:Date:From; b=u3Jw8D8fzeZSfcm99Br39P6Ogvg44PF6LGnE03a8jPAw0Kr6FHT2aDIt80uBqGMer Mbkl5zMiLJlHTFdo5PROncvJn4tQsUlieP8qwv05wOLuS2t4cuiVcDxhfgs6me6QWY IdOWYRNp4LOyQ+d1Q3RIeCWRKZrezc+njvqmwlew= From: "brunopitrus at hotmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/114267] New: bogus -Wsubobject-linkage when using lambda members as template parameters Date: Thu, 07 Mar 2024 13:22:58 +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: 14.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: brunopitrus at hotmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: 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 target_milestone 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D114267 Bug ID: 114267 Summary: bogus -Wsubobject-linkage when using lambda members as template parameters Product: gcc Version: 14.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: brunopitrus at hotmail dot com Target Milestone: --- header.h: ``` struct F{ constexpr static const auto algorithm=3D[]() {}; }; constexpr inline const auto algorithm=3D[]() {}; template struct G{}; struct S{ G foo; //ok G lol; //Wsubobject-linkage }; ``` main.cpp: //can be empty See it on godbolt: https://godbolt.org/z/qccjfTPnr The behavior is inconsistent between the lambda declared as a member and as= a non-member. Moreover, if i compile this code with -O0, the resultant object= has a =E2=80=98r=E2=80=99 private symbol for F::algorithm, which makes me suspe= ct that wrong code is being generated.=