From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id BA3CF3858C62; Wed, 28 Feb 2024 12:15:05 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BA3CF3858C62 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1709122505; bh=WCfE5LnQ+DlZ3IvT5Xetj/MRCC9A1bE31gzN05GQDpU=; h=From:To:Subject:Date:In-Reply-To:References:From; b=x8g7M5ldVnB3khhngAVaetHVjy+SaMbEkGzXidjVfAQ4TsbExaWQjM4s7XSeKPZpq y2Z50LjnqHRg3SUOukVpqSbWCOPEaWgpQitUMfoTrsr0+iMi32CbzT8mMfTigReGaL fqeypagTujJ2xgc5D/SSC5EJ8lDv2OUnvZtAvKVY= From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/92687] decltype of a structured binding to a tuple component is a reference type inside a template function Date: Wed, 28 Feb 2024 12:15:05 +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: 9.2.0 X-Bugzilla-Keywords: rejects-valid X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub 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: cc 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D92687 Jakub Jelinek changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jakub at gcc dot gnu.org --- Comment #3 from Jakub Jelinek --- Testcase without using library: namespace std { template struct tuple_size; template struct tuple_element; } struct A { int i; template int& get() { return i; } }; template<> struct std::tuple_size { static const int value =3D 2; }; template struct std::tuple_element { using type =3D int; }; template struct is_reference { static const bool value =3D false; }; template struct is_reference { static const bool value =3D true; }; template struct is_reference { static const bool value =3D true; }; template void foo () { auto [x, y] =3D A {}; static_assert (!is_reference::value, ""); } void bar () { auto [x, y] =3D A {}; static_assert (!is_reference::value, ""); } template void baz () { auto [x, y] =3D T {}; static_assert (!is_reference::value, ""); } void qux () { foo<0> (); baz (); } which shows it is only for the non-dependent structured binding in a templa= te case.=