public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "redi at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/101460] Useless cascade of overload resolution errors for invalid expression Date: Thu, 15 Jul 2021 11:58:53 +0000 [thread overview] Message-ID: <bug-101460-4-386fdaGT1M@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-101460-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101460 Jonathan Wakely <redi at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Last reconfirmed| |2021-07-15 Ever confirmed|0 |1 --- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> --- I suppose the problem here is that the failed constant evaluation of frob<-1>() only happens as a result of trying to use it as a template argument (where a constant expression is required) which doesn't happen until overload resolution is performed. So we have to at least being doing OR before we get a problem. But maybe we can remember that it failed once, and so stop trying. If it's not a valid constant expression, *that* is the error, not the fact that none of the get<N> overloads can be called with an invalid constant expression. Even if I change the code to do this it keeps trying overload resolution for get<n>: template<int N> void get_n(tuple& t) { constexpr unsigned n = frob<N>(); get<n>(t); } The constexpr initialization of 'n' failed with a static_assert *and* a non-constant narrowing conversion, so why do we continue and even attempt overload resolution for 'get'?
next prev parent reply other threads:[~2021-07-15 11:58 UTC|newest] Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-07-15 11:11 [Bug c++/101460] New: " redi at gcc dot gnu.org 2021-07-15 11:58 ` redi at gcc dot gnu.org [this message] 2021-07-15 12:04 ` [Bug c++/101460] " redi at gcc dot gnu.org 2021-07-15 15:26 ` cvs-commit at gcc dot gnu.org 2021-07-19 12:38 ` cvs-commit at gcc dot gnu.org 2021-08-30 13:45 ` jason at gcc dot gnu.org 2021-08-30 21:23 ` cvs-commit at gcc dot gnu.org 2021-08-30 21:29 ` jason at gcc dot gnu.org
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-101460-4-386fdaGT1M@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: linkBe 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).