From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 394913858CDB; Fri, 7 Oct 2022 11:53:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 394913858CDB DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1665143593; bh=mXKkj6Je7sBgnUGDOqe1OizrtV7O1I9qoKjgtl0mLV8=; h=From:To:Subject:Date:From; b=a89hxWq33rypu9H5SALUrztUsxgCUghef285Cri8MpLVY0V9Prcy+qaOU+6xDA82B RTLmblHSlTsrUtci1+EDEDRqRB1ugHo5e9AwE/CsqWLnXjOz/0dMfpjSTYfGRLrCdf 90ria2bKBAXFIyqLICk9ZY26+Q7g7Z7Vt0bP/UZ0= From: "redi at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/107179] New: requires-expression gives hard error for inaccessible constructor Date: Fri, 07 Oct 2022 11:53:12 +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: 12.2.1 X-Bugzilla-Keywords: rejects-valid X-Bugzilla-Severity: normal X-Bugzilla-Who: redi at gcc dot gnu.org 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 keywords 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=3D107179 Bug ID: 107179 Summary: requires-expression gives hard error for inaccessible constructor Product: gcc Version: 12.2.1 Status: UNCONFIRMED Keywords: rejects-valid Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: redi at gcc dot gnu.org Target Milestone: --- template struct bool_constant { static constexpr bool value =3D B; = }; template struct is_implicitly_default_constructible : bool_constant { }; class X { X(); public: X(int); }; static_assert( !is_implicitly_default_constructible::value ); This should compile with -std=3Dc++20 but doesn't: conv.cc: In instantiation of 'struct is_implicitly_default_constructible= ': conv.cc:14:55: required from here conv.cc:5:53: error: 'X::X()' is private within this context 5 | : bool_constant | ~^~~~ conv.cc:9:3: note: declared private here 9 | X(); | ^ conv.cc:14:16: error: static assertion failed 14 | static_assert( !is_implicitly_default_constructible::value ); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=