From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id D66703858D35; Mon, 20 Nov 2023 05:08:02 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D66703858D35 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1700456882; bh=aACGr0UyBnsqe3V3AjrZjNbbora/RUSOp9VYiw1G8MQ=; h=From:To:Subject:Date:From; b=YAslYln8DzefYM84FQJMFaq1cCPAfpO7JOVCwmtOS5QX5US5oDKZRlA78ZX7RttN0 MZ6TgM9xU/bWkSYZBMbLcIALxrTtcKj/BioIuIFn5uZiRjlN4OY83iH88jpuzikOBu /Ki+Ksi32MrIKjtNOogIPCF1d5Fv7uuLnWPHV+sA= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/112632] New: [14 Regression] Non-type template parameter created with converting constructor sometimes has original type Date: Mon, 20 Nov 2023 05:08:02 +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: needs-bisection, rejects-valid X-Bugzilla-Severity: normal X-Bugzilla-Who: pinskia 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=3D112632 Bug ID: 112632 Summary: [14 Regression] Non-type template parameter created with converting constructor sometimes has original type Product: gcc Version: 14.0 Status: UNCONFIRMED Keywords: needs-bisection, rejects-valid Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: pinskia at gcc dot gnu.org Target Milestone: --- Take: ``` template inline constexpr bool C =3D true; struct n { constexpr n(int a) : i(a) {} int i; }; template using get_n_i_type =3D decltype(N.i); template int f() { using iii =3D get_n_i_type; #if 1 // Change to 0 and this compiles static_assert(C); #endif return iii{}; } template int f<3>(); ``` This is rejected on the trunk with: ``` : In instantiation of 'int f() [with int X =3D 3]': :22:23: required from here 22 | template int f<3>(); | ^ :11:37: error: request for member 'i' in '3', which is of non-class type 'int' 11 | using get_n_i_type =3D decltype(N.i); | ~~^ ``` But was accepted in GCC 13. Note the difference between this and PR 112594= is that C here is declared an `inline constexpr` rather than a concept.=