From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 7BF1F386103D; Mon, 24 Jun 2024 06:11:31 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7BF1F386103D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1719209491; bh=XS7zid5VPxOTUjjuoCx2yC7/yFV6IzTi+JQycVENCLI=; h=From:To:Subject:Date:In-Reply-To:References:From; b=RNc30tShdlYWHx1OHaOLPolyzF2Pq4B4Z6bSx0PUA8JJcRNnQoEbz9IvjZhT7Jakf FVg9rOxFSGjQR/Q4jW60hqAm7wF1g5NOoX+qyO3ruTVsLeRprU0n7+gB6xBI70VSiy Eo9blQU8yXatUXlsodAH5wMhjdwICF/VjzHoP5mU= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/115605] structured binding break if a variable named tuple_size is visibile at the decomposition site Date: Mon, 24 Jun 2024 06:11:30 +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: 15.0 X-Bugzilla-Keywords: rejects-valid X-Bugzilla-Severity: normal X-Bugzilla-Who: pinskia 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: 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=3D115605 --- Comment #2 from Andrew Pinski --- Oh I think I see how it should be fixed. The way std::initializer_list is handled is correct: static tree listify (tree arg) { tree std_init_list =3D lookup_qualified_name (std_node, init_list_identif= ier); ...=20=20 return lookup_template_class (std_init_list, argvec, NULL_TREE, NULL_TREE, tf_warning_or_error); That is: ``` #include void f() { int initializer_list; std::vector tt =3D {0, 1, 2,3}; } ``` Works just fine. If nobody gets to this soon, I might go and try to fix the use of lookup_template_class for those 3 cases to use lookup_qualified_name first= .=