public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <gcc-bugzilla@gcc.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	[thread overview]
Message-ID: <bug-66968-4-j7dAT8jeDq@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-66968-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66968

--- Comment #6 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jonathan Wakely <redi@gcc.gnu.org>:

https://gcc.gnu.org/g:3dbc7b809a62167b36f217ab5f43207be19e5908

commit r12-2379-g3dbc7b809a62167b36f217ab5f43207be19e5908
Author: Jonathan Wakely <jwakely@redhat.com>
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<I>(const tuple<Types...>&).
    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 >=
sizeof... (_Types))> std::get(const std::tuple<_Types ...>&) [with long
unsigned int __i = 1; _Elements = {int}; std::__enable_if_t<(__i >= sizeof...
(_Types))> = 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 <jwakely@redhat.com>

    libstdc++-v3/ChangeLog:

            * include/std/tuple (get<I>): Add deleted overload for bad
            index.
            * testsuite/20_util/tuple/element_access/get_neg.cc: Adjust
            expected errors.

  parent reply	other threads:[~2021-07-16 22:05 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-22 13:37 [Bug c++/66968] New: " redi at gcc dot gnu.org
2015-07-25 18:44 ` [Bug c++/66968] " manu at gcc dot gnu.org
2015-07-25 22:10 ` redi at gcc dot gnu.org
2021-07-16 20:24 ` redi at gcc dot gnu.org
2021-07-16 22:05 ` cvs-commit at gcc dot gnu.org [this message]
2021-07-16 22:11 ` redi at gcc dot gnu.org
2022-07-13 12:34 ` redi at gcc dot gnu.org
2023-02-06 10:18 ` vanyacpp at gmail dot com
2023-02-06 10:20 ` vanyacpp at gmail dot com

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-66968-4-j7dAT8jeDq@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).