From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 2E7B039ACC00; Fri, 16 Jul 2021 22:05:31 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2E7B039ACC00 From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/66968] Incorrect template argument shown in diagnostic Date: Fri, 16 Jul 2021 22:05:31 +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: 6.0 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Jul 2021 22:05:31 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D66968 --- Comment #6 from CVS Commits --- The master branch has been updated by Jonathan Wakely : https://gcc.gnu.org/g:3dbc7b809a62167b36f217ab5f43207be19e5908 commit r12-2379-g3dbc7b809a62167b36f217ab5f43207be19e5908 Author: Jonathan Wakely Date: Fri Jul 16 20:59:43 2021 +0100 libstdc++: Improve diagnostics for std::get with invalid tuple index This adds a deleted overload of std::get(const tuple&). Invalid calls with an out of range index will match the deleted overload and give a single, clear error about calling a deleted function, instead of overload resolution errors for every std::get overload in the library. This changes the current output of 15+ errors (plus notes and associated header context) into just two errors (plus context): error: static assertion failed: tuple index must be in range error: use of deleted function 'constexpr std::__enable_if_t<(__i >=3D sizeof... (_Types))> std::get(const std::tuple<_Types ...>&) [with long unsigned int __i =3D 1; _Elements =3D {int}; std::__enable_if_t<(__i >=3D s= izeof... (_Types))> =3D void]' This seems like a nice improvement, although PR c++/66968 means that "_Types" is printed in the signature rather than "_Elements". Signed-off-by: Jonathan Wakely libstdc++-v3/ChangeLog: * include/std/tuple (get): Add deleted overload for bad index. * testsuite/20_util/tuple/element_access/get_neg.cc: Adjust expected errors.=