From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id E429B3858D35; Fri, 24 Mar 2023 16:08:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E429B3858D35 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1679674106; bh=iQgGPpx8VeXR1I/ZovVE9oON2tOsenIb/25uu0ySHSA=; h=From:To:Subject:Date:In-Reply-To:References:From; b=prm2kUtiCh1OrCE01dL3pp7xdGBTIeBii3rkTBLzgqgviRkumfnmE5lz01Tej4FmH r9mPoKlvNFxNG8U/iojXf8KhhZFnXulj6btgbJ8b5r5GlKA2k6kgvtXMO1nc7vY4xX El2fdrZ4SqnSUMVoDvZHjRFe7iX4srSnL8wGE/ko= From: "ppalka at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/97740] [10/11/12/13 Regression] Weird error message about accessing a private member of my own class inside of std::string_view inside of constexpr Date: Fri, 24 Mar 2023 16:08:25 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 11.0 X-Bugzilla-Keywords: rejects-valid X-Bugzilla-Severity: normal X-Bugzilla-Who: ppalka at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 10.5 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: target_milestone see_also short_desc cc 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D97740 Patrick Palka changed: What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|--- |10.5 See Also| |https://gcc.gnu.org/bugzill | |a/show_bug.cgi?id=3D96716 Summary|Weird error message about |[10/11/12/13 Regression] |accessing a private member |Weird error message about |of my own class inside of |accessing a private member |std::string_view inside of |of my own class inside of |constexpr |std::string_view inside of | |constexpr CC| |jason at gcc dot gnu.org, | |ppalka at gcc dot gnu.org --- Comment #3 from Patrick Palka --- Here's a reduced C++11 testcase that became rejects-valid after r10-6416-g8fda2c274ac66d: struct A { constexpr const int* get() const { return &m; } private: int m =3D 42; } a; struct B { const int* p; }; template void f() { constexpr B b =3D {a.get()}; } template void f(); : In function =E2=80=98void f()=E2=80=99: :11:25: error: =E2=80=98int A::m=E2=80=99 is private within this con= text :4:7: note: declared private here : In instantiation of =E2=80=98void f() [with =3D int]=E2=80=99: :14:22: required from here :11:25: error: =E2=80=98int A::m=E2=80=99 is private within this con= text :4:7: note: declared private here=