public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/105221] New: gcc rejects true ? [](auto) noexcept {} : [](int) {}
@ 2022-04-11 14:25 hewillk at gmail dot com
2022-11-08 23:23 ` [Bug c++/105221] gcc rejects true ? [](auto) noexcept {} : [](int) {} in C++17+ (works for C++14) pinskia at gcc dot gnu.org
` (11 more replies)
0 siblings, 12 replies; 13+ messages in thread
From: hewillk at gmail dot com @ 2022-04-11 14:25 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105221
Bug ID: 105221
Summary: gcc rejects true ? [](auto) noexcept {} : [](int) {}
Product: gcc
Version: 12.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: hewillk at gmail dot com
Target Milestone: ---
int main() {
true ? [](auto) noexcept {} : [](int) {};
}
GCC-trunk only accepts the above code in C++14 but rejects it in C++17/20.
https://godbolt.org/z/7r4dKbo73
But it seems like it should be well-formed, you can see the explanation in SO:
https://stackoverflow.com/questions/71826315/ternary-operator-applied-to-different-lambdas-produces-inconsistent-results
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug c++/105221] gcc rejects true ? [](auto) noexcept {} : [](int) {} in C++17+ (works for C++14)
2022-04-11 14:25 [Bug c++/105221] New: gcc rejects true ? [](auto) noexcept {} : [](int) {} hewillk at gmail dot com
@ 2022-11-08 23:23 ` pinskia at gcc dot gnu.org
2022-11-08 23:24 ` [Bug c++/105221] [10/11/12/13 Regression] " pinskia at gcc dot gnu.org
` (10 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-11-08 23:23 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105221
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |c++-lambda
Last reconfirmed| |2022-11-08
Summary|gcc rejects true ? [](auto) |gcc rejects true ? [](auto)
|noexcept {} : [](int) {} |noexcept {} : [](int) {} in
| |C++17+ (works for C++14)
Status|UNCONFIRMED |NEW
Ever confirmed|0 |1
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Confirmed.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug c++/105221] [10/11/12/13 Regression] gcc rejects true ? [](auto) noexcept {} : [](int) {} in C++17+ (works for C++14)
2022-04-11 14:25 [Bug c++/105221] New: gcc rejects true ? [](auto) noexcept {} : [](int) {} hewillk at gmail dot com
2022-11-08 23:23 ` [Bug c++/105221] gcc rejects true ? [](auto) noexcept {} : [](int) {} in C++17+ (works for C++14) pinskia at gcc dot gnu.org
@ 2022-11-08 23:24 ` pinskia at gcc dot gnu.org
2022-11-11 18:42 ` mpolacek at gcc dot gnu.org
` (9 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-11-08 23:24 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105221
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|gcc rejects true ? [](auto) |[10/11/12/13 Regression]
|noexcept {} : [](int) {} in |gcc rejects true ? [](auto)
|C++17+ (works for C++14) |noexcept {} : [](int) {} in
| |C++17+ (works for C++14)
Known to work| |6.1.0
Keywords| |needs-bisection
Known to fail| |7.1.0, 8.1.0
--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Worked in GCC 6 even with an explict -std=c++17 .
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug c++/105221] [10/11/12/13 Regression] gcc rejects true ? [](auto) noexcept {} : [](int) {} in C++17+ (works for C++14)
2022-04-11 14:25 [Bug c++/105221] New: gcc rejects true ? [](auto) noexcept {} : [](int) {} hewillk at gmail dot com
2022-11-08 23:23 ` [Bug c++/105221] gcc rejects true ? [](auto) noexcept {} : [](int) {} in C++17+ (works for C++14) pinskia at gcc dot gnu.org
2022-11-08 23:24 ` [Bug c++/105221] [10/11/12/13 Regression] " pinskia at gcc dot gnu.org
@ 2022-11-11 18:42 ` mpolacek at gcc dot gnu.org
2022-11-29 16:49 ` pinskia at gcc dot gnu.org
` (8 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2022-11-11 18:42 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105221
Marek Polacek <mpolacek at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |mpolacek at gcc dot gnu.org
--- Comment #3 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Started with r241944 most likely.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug c++/105221] [10/11/12/13 Regression] gcc rejects true ? [](auto) noexcept {} : [](int) {} in C++17+ (works for C++14)
2022-04-11 14:25 [Bug c++/105221] New: gcc rejects true ? [](auto) noexcept {} : [](int) {} hewillk at gmail dot com
` (2 preceding siblings ...)
2022-11-11 18:42 ` mpolacek at gcc dot gnu.org
@ 2022-11-29 16:49 ` pinskia at gcc dot gnu.org
2022-12-02 14:07 ` jakub at gcc dot gnu.org
` (7 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-11-29 16:49 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105221
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|--- |10.5
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug c++/105221] [10/11/12/13 Regression] gcc rejects true ? [](auto) noexcept {} : [](int) {} in C++17+ (works for C++14)
2022-04-11 14:25 [Bug c++/105221] New: gcc rejects true ? [](auto) noexcept {} : [](int) {} hewillk at gmail dot com
` (3 preceding siblings ...)
2022-11-29 16:49 ` pinskia at gcc dot gnu.org
@ 2022-12-02 14:07 ` jakub at gcc dot gnu.org
2022-12-20 13:39 ` rguenth at gcc dot gnu.org
` (6 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-12-02 14:07 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105221
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jakub at gcc dot gnu.org,
| |jason at gcc dot gnu.org,
| |ppalka at gcc dot gnu.org
--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
P0012R1 added what is now http://eel.is/c++draft/temp.deduct.conv#5.2 , at that
point:
``If the original A is a function pointer type, A can be "pointer to function"
even if the deduced A is "pointer to noexcept function".
If the original A is a pointer to member function type, A can be "pointer to
member of type function" even if the deduced A is "pointer to member of type
noexcept function".''
but I don't see in pt.cc anything keyed on DEDUCE_CONV that would deal with
this.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug c++/105221] [10/11/12/13 Regression] gcc rejects true ? [](auto) noexcept {} : [](int) {} in C++17+ (works for C++14)
2022-04-11 14:25 [Bug c++/105221] New: gcc rejects true ? [](auto) noexcept {} : [](int) {} hewillk at gmail dot com
` (4 preceding siblings ...)
2022-12-02 14:07 ` jakub at gcc dot gnu.org
@ 2022-12-20 13:39 ` rguenth at gcc dot gnu.org
2022-12-27 14:19 ` [Bug c++/105221] [10/11/12/13 Regression] gcc rejects true ? [](auto) noexcept {} : [](int) {} in C++17+ (works for C++14) since r7-4383-g51dc660315ef83dc marxin at gcc dot gnu.org
` (5 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-12-20 13:39 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105221
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Priority|P3 |P2
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug c++/105221] [10/11/12/13 Regression] gcc rejects true ? [](auto) noexcept {} : [](int) {} in C++17+ (works for C++14) since r7-4383-g51dc660315ef83dc
2022-04-11 14:25 [Bug c++/105221] New: gcc rejects true ? [](auto) noexcept {} : [](int) {} hewillk at gmail dot com
` (5 preceding siblings ...)
2022-12-20 13:39 ` rguenth at gcc dot gnu.org
@ 2022-12-27 14:19 ` marxin at gcc dot gnu.org
2023-03-30 14:14 ` jason at gcc dot gnu.org
` (4 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: marxin at gcc dot gnu.org @ 2022-12-27 14:19 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105221
Martin Liška <marxin at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |marxin at gcc dot gnu.org
Summary|[10/11/12/13 Regression] |[10/11/12/13 Regression]
|gcc rejects true ? [](auto) |gcc rejects true ? [](auto)
|noexcept {} : [](int) {} in |noexcept {} : [](int) {} in
|C++17+ (works for C++14) |C++17+ (works for C++14)
| |since
| |r7-4383-g51dc660315ef83dc
Keywords|needs-bisection |
--- Comment #5 from Martin Liška <marxin at gcc dot gnu.org> ---
(In reply to Marek Polacek from comment #3)
> Started with r241944 most likely.
Yes, it started with r7-4383-g51dc660315ef83dc.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug c++/105221] [10/11/12/13 Regression] gcc rejects true ? [](auto) noexcept {} : [](int) {} in C++17+ (works for C++14) since r7-4383-g51dc660315ef83dc
2022-04-11 14:25 [Bug c++/105221] New: gcc rejects true ? [](auto) noexcept {} : [](int) {} hewillk at gmail dot com
` (6 preceding siblings ...)
2022-12-27 14:19 ` [Bug c++/105221] [10/11/12/13 Regression] gcc rejects true ? [](auto) noexcept {} : [](int) {} in C++17+ (works for C++14) since r7-4383-g51dc660315ef83dc marxin at gcc dot gnu.org
@ 2023-03-30 14:14 ` jason at gcc dot gnu.org
2023-03-30 14:17 ` jason at gcc dot gnu.org
` (3 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: jason at gcc dot gnu.org @ 2023-03-30 14:14 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105221
--- Comment #6 from Jason Merrill <jason at gcc dot gnu.org> ---
Reduced:
void (*p)(int) = [](auto) noexcept {};
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug c++/105221] [10/11/12/13 Regression] gcc rejects true ? [](auto) noexcept {} : [](int) {} in C++17+ (works for C++14) since r7-4383-g51dc660315ef83dc
2022-04-11 14:25 [Bug c++/105221] New: gcc rejects true ? [](auto) noexcept {} : [](int) {} hewillk at gmail dot com
` (7 preceding siblings ...)
2023-03-30 14:14 ` jason at gcc dot gnu.org
@ 2023-03-30 14:17 ` jason at gcc dot gnu.org
2023-03-30 22:26 ` cvs-commit at gcc dot gnu.org
` (2 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: jason at gcc dot gnu.org @ 2023-03-30 14:17 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105221
Jason Merrill <jason at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Assignee|unassigned at gcc dot gnu.org |jason at gcc dot gnu.org
Status|NEW |ASSIGNED
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug c++/105221] [10/11/12/13 Regression] gcc rejects true ? [](auto) noexcept {} : [](int) {} in C++17+ (works for C++14) since r7-4383-g51dc660315ef83dc
2022-04-11 14:25 [Bug c++/105221] New: gcc rejects true ? [](auto) noexcept {} : [](int) {} hewillk at gmail dot com
` (8 preceding siblings ...)
2023-03-30 14:17 ` jason at gcc dot gnu.org
@ 2023-03-30 22:26 ` cvs-commit at gcc dot gnu.org
2023-07-07 10:43 ` [Bug c++/105221] [11/12/13/14 " rguenth at gcc dot gnu.org
2023-12-20 16:53 ` [Bug c++/105221] [11/12 " jason at gcc dot gnu.org
11 siblings, 0 replies; 13+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-03-30 22:26 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105221
--- Comment #7 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The trunk branch has been updated by Jason Merrill <jason@gcc.gnu.org>:
https://gcc.gnu.org/g:85131af0603c0af2aa6b40de6cc929905f22bd50
commit r13-6948-g85131af0603c0af2aa6b40de6cc929905f22bd50
Author: Jason Merrill <jason@redhat.com>
Date: Thu Mar 30 11:07:17 2023 -0400
c++: generic lambda and function ptr conv [PR105221]
We weren't properly considering the function pointer conversions in
deduction between FUNCTION_TYPE; we just hardcoded the
UNIFY_ALLOW_MORE_CV_QUAL semantics, which are backwards when deducing for a
template conversion function like the one in a generic lambda. And when I
started checking the ALLOW flags, I needed to make sure they stay set to
avoid breaking trailing13.C.
PR c++/105221
gcc/cp/ChangeLog:
* pt.cc (unify) [FUNCTION_TYPE]: Handle function pointer
conversions.
gcc/testsuite/ChangeLog:
* g++.dg/cpp1z/noexcept-type27.C: New test.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug c++/105221] [11/12/13/14 Regression] gcc rejects true ? [](auto) noexcept {} : [](int) {} in C++17+ (works for C++14) since r7-4383-g51dc660315ef83dc
2022-04-11 14:25 [Bug c++/105221] New: gcc rejects true ? [](auto) noexcept {} : [](int) {} hewillk at gmail dot com
` (9 preceding siblings ...)
2023-03-30 22:26 ` cvs-commit at gcc dot gnu.org
@ 2023-07-07 10:43 ` rguenth at gcc dot gnu.org
2023-12-20 16:53 ` [Bug c++/105221] [11/12 " jason at gcc dot gnu.org
11 siblings, 0 replies; 13+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-07-07 10:43 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105221
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|10.5 |11.5
--- Comment #8 from Richard Biener <rguenth at gcc dot gnu.org> ---
GCC 10 branch is being closed.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug c++/105221] [11/12 Regression] gcc rejects true ? [](auto) noexcept {} : [](int) {} in C++17+ (works for C++14) since r7-4383-g51dc660315ef83dc
2022-04-11 14:25 [Bug c++/105221] New: gcc rejects true ? [](auto) noexcept {} : [](int) {} hewillk at gmail dot com
` (10 preceding siblings ...)
2023-07-07 10:43 ` [Bug c++/105221] [11/12/13/14 " rguenth at gcc dot gnu.org
@ 2023-12-20 16:53 ` jason at gcc dot gnu.org
11 siblings, 0 replies; 13+ messages in thread
From: jason at gcc dot gnu.org @ 2023-12-20 16:53 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105221
Jason Merrill <jason at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Target Milestone|11.5 |13.0
Resolution|--- |FIXED
--- Comment #9 from Jason Merrill <jason at gcc dot gnu.org> ---
Fixed in 13. The fix seems a bit risky for backporting, but I'm open to it if
there's any interest.
^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2023-12-20 16:53 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-11 14:25 [Bug c++/105221] New: gcc rejects true ? [](auto) noexcept {} : [](int) {} hewillk at gmail dot com
2022-11-08 23:23 ` [Bug c++/105221] gcc rejects true ? [](auto) noexcept {} : [](int) {} in C++17+ (works for C++14) pinskia at gcc dot gnu.org
2022-11-08 23:24 ` [Bug c++/105221] [10/11/12/13 Regression] " pinskia at gcc dot gnu.org
2022-11-11 18:42 ` mpolacek at gcc dot gnu.org
2022-11-29 16:49 ` pinskia at gcc dot gnu.org
2022-12-02 14:07 ` jakub at gcc dot gnu.org
2022-12-20 13:39 ` rguenth at gcc dot gnu.org
2022-12-27 14:19 ` [Bug c++/105221] [10/11/12/13 Regression] gcc rejects true ? [](auto) noexcept {} : [](int) {} in C++17+ (works for C++14) since r7-4383-g51dc660315ef83dc marxin at gcc dot gnu.org
2023-03-30 14:14 ` jason at gcc dot gnu.org
2023-03-30 14:17 ` jason at gcc dot gnu.org
2023-03-30 22:26 ` cvs-commit at gcc dot gnu.org
2023-07-07 10:43 ` [Bug c++/105221] [11/12/13/14 " rguenth at gcc dot gnu.org
2023-12-20 16:53 ` [Bug c++/105221] [11/12 " jason at gcc dot gnu.org
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).