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 libstdc++/104606] [11/12/13/14 Regression] comparison operator resolution with std::optional and -std=c++20
Date: Wed, 27 Mar 2024 23:11:31 +0000	[thread overview]
Message-ID: <bug-104606-4-C9HJBRWAh8@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-104606-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #13 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Andrew Pinski from comment #5)
> (In reply to Jakub Jelinek from comment #4)
> > Just wild guess, perhaps the PR98842 changes between 11.1 and 11.2?
> 
> That would mean it is a bug in GCC 10.4 also :(.

It's not, even though 10.4 has the library change. Compiling the test case with
10.4 works. But preprocessing with 10.4 and then compiling with 11.1 fails,
confirming a front end change is to blame.

Bisection shows it started to error with r11-2774

c++: Check satisfaction before non-dep convs. [CWG2369]

It's very hard to use concepts to protect a template from hard errors due to
unwanted instantiation if constraints aren't checked until after doing all
substitution and checking of non-dependent conversions.

It was pretty straightforward to insert the satisfaction check into the
logic, but I needed to make the 3-parameter version of
satisfy_declaration_constraints call push_tinst_level like the 2-parameter
version already does.  For simplicity, I also made it add any needed outer
template arguments from the TEMPLATE_DECL to the args.

The testsuite changes are mostly because this change causes unsatisfaction
to cause deduction to fail rather than reject the candidate later in
overload resolution.

gcc/cp/ChangeLog:

DR 2369
* cp-tree.h (push_tinst_level, push_tinst_level_loc): Declare.
* constraint.cc (satisfy_declaration_constraints):
Use add_outermost_template_args and push_tinst_level.
* pt.c (add_outermost_template_args): Handle getting
a TEMPLATE_DECL as the first argument.
(push_tinst_level, push_tinst_level_loc): No longer static.
(fn_type_unification): Check satisfaction before non-dependent
conversions.

  parent reply	other threads:[~2024-03-27 23:11 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-19 16:03 [Bug libstdc++/104606] New: Regression in comparison operator resolution with std::optional julien.philippon at epitech dot eu
2022-02-19 16:07 ` [Bug libstdc++/104606] " julien.philippon at epitech dot eu
2022-02-19 22:17 ` [Bug c++/104606] [11/12 Regression] comparison operator resolution with std::optional and -std=c++20 pinskia at gcc dot gnu.org
2022-02-19 22:38 ` jakub at gcc dot gnu.org
2022-02-19 22:46 ` jakub at gcc dot gnu.org
2022-02-19 22:59 ` [Bug libstdc++/104606] [10/11/12 " pinskia at gcc dot gnu.org
2022-02-20  7:38 ` jakub at gcc dot gnu.org
2022-02-20  7:45 ` jakub at gcc dot gnu.org
2022-02-21  9:47 ` rguenth at gcc dot gnu.org
2022-02-21 21:01 ` redi at gcc dot gnu.org
2022-06-28 10:48 ` [Bug libstdc++/104606] [10/11/12/13 " jakub at gcc dot gnu.org
2023-07-07 10:42 ` [Bug libstdc++/104606] [11/12/13/14 " rguenth at gcc dot gnu.org
2024-03-27 20:58 ` redi at gcc dot gnu.org
2024-03-27 21:41 ` redi at gcc dot gnu.org
2024-03-27 23:11 ` redi at gcc dot gnu.org [this message]
2024-04-03 10:53 ` cvs-commit at gcc dot gnu.org
2024-05-02 14:16 ` [Bug libstdc++/104606] [11/12/13 " cvs-commit at gcc dot gnu.org
2024-05-02 14:16 ` [Bug libstdc++/104606] [11/12 " redi 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-104606-4-C9HJBRWAh8@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).