From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 220393858C33; Wed, 8 Nov 2023 05:13:00 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 220393858C33 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1699420380; bh=FYveSeCcTO67pAi1s2DqlSnDREu46JaO5+2Hx7yziys=; h=From:To:Subject:Date:From; b=QbzVUfEB8xLXon2PJ9GHA+AzHExFZbMBRd3Mxh24mAU7ChQgnG2JW9MkKAD9Gg6Br 04VQNu6ypfLUGTD+mo9gioWluLOAD0nyX46Xl7A7J2ugsfkG29TRzqHMhWC43V33Cv 8hGqc+p364krfpsZD/SMEbwJT2dEtdAcWJGDrtf0= From: "arthur.j.odwyer at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/112436] New: SFINAE-unfriendly error on throwing pointer to incomplete type Date: Wed, 08 Nov 2023 05:12:59 +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: arthur.j.odwyer at gmail 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=3D112436 Bug ID: 112436 Summary: SFINAE-unfriendly error on throwing pointer to incomplete type Product: gcc Version: 14.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: arthur.j.odwyer at gmail dot com Target Milestone: --- =3D=3D=3D=3D template concept Throwable =3D requires { throw T(); }; struct Incomplete; static_assert(!Throwable); static_assert(!Throwable); =3D=3D=3D=3D :2:32: error: invalid use of incomplete type 'struct Incomplete' 2 | concept Throwable =3D requires { throw T(); }; | ^~~~~~~~~ :3:8: note: forward declaration of 'struct Incomplete' 3 | struct Incomplete; | ^~~~~~~~~~ :2:32: error: invalid use of array with unspecified bounds 2 | concept Throwable =3D requires { throw T(); }; | ^~~~~~~~~ Instead of a hard error in both cases, we expect the concept to be false and the static_assert to succeed. Clang and EDG succeed. MSVC succeeds on `Incomplete*` and incorrectly permits throwing `int(*)[]`. The terse/multi-purpose "invalid use of..." error message seems to come up a lot in Bugzilla, but I didn't see any search hits for that message plus the word "throw". Bug #98388 is probably related.=