From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 8F4963858D20; Wed, 1 May 2024 08:06:45 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8F4963858D20 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1714550805; bh=R40Mro85XFVpXf6owbZPwenYDg+m6WhXbQEZVV+XsnU=; h=From:To:Subject:Date:From; b=CG1PzvsqKod43IKnPU/fk4StCjtl9QcHe8OoYExCQGwKNff6uzC/9F8ppwbEHP4rr 90E2Dl9tB8NOA3fS/XpDubWX3FUrW4lV5kFTZ9fSQTfS6ZTnV31RJRqBSU77QgaTtB EA79dWwQ4Kh5WS2kPKGeiD1Jr4f4CcC+H1lvZIKU= From: "hokein.wu at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/114903] New: constraint of CTAD alias deduction guide is evaluated on a wrong type Date: Wed, 01 May 2024 08:06:44 +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: unknown X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: hokein.wu 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=3D114903 Bug ID: 114903 Summary: constraint of CTAD alias deduction guide is evaluated on a wrong type Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: hokein.wu at gmail dot com Target Milestone: --- See the following example of nested templates:=20=20 ``` #include template struct Key { Key(int); }; class Forward {}; template constexpr bool C =3D std::is_same(); // changing `Forward` to `double` will make= the following static_assert passed. template struct Outer { template struct Foo { Foo(U); U u; }; template requires(C) Foo(V) -> Foo; }; template struct T { template struct T2 { template using AFoo =3D Outer::template Foo; }; }; T::T2::AFoo a{1.0}; // the explict deduction guide shoul= d be choosen, Foo static_assert(std::is_same::Foo>()); // ex= pect to be true! ``` The constraint `C` in the alias deduction guide should be true, as it is evaluated on type `Forward`, but gcc seems to evaluate it on `double`.=