From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id A1DCA388E800; Fri, 23 Jul 2021 20:15:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A1DCA388E800 From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/78609] invalid member's visibility detection in constexpr with arrays Date: Fri, 23 Jul 2021 20:15:17 +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: 6.2.0 X-Bugzilla-Keywords: rejects-valid X-Bugzilla-Severity: normal X-Bugzilla-Who: pinskia 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: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cf_reconfirmed_on short_desc bug_status everconfirmed 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: Fri, 23 Jul 2021 20:15:17 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D78609 Andrew Pinski changed: What |Removed |Added ---------------------------------------------------------------------------- Last reconfirmed| |2021-07-23 Summary|invalid member's visibility |invalid member's visibility |detection in constexpr |detection in constexpr with | |arrays Status|UNCONFIRMED |NEW Ever confirmed|0 |1 --- Comment #3 from Andrew Pinski --- Confirmed. The problem is with taking the address of a field and templates. Here is a reduced testcase: struct A { private: char data; public: constexpr const char *c_str() const { return &data; } constexpr A(char const str) : data(str) {}; constexpr A() : data() {}; }; template struct B { static const constexpr A name =3D A{'a'}; static const constexpr char * value =3D name.c_str(); }; template const constexpr A B::name; const char *c =3D B<0>::value; ---- CUT ---- If I make B a non-template, then it will work correctly.=