public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/110025] New: ICE with default-argument for template-param with decltype and auto.
@ 2023-05-29 15:09 jehelset at gmail dot com
2023-05-29 18:09 ` [Bug c++/110025] " jehelset at gmail dot com
` (7 more replies)
0 siblings, 8 replies; 9+ messages in thread
From: jehelset at gmail dot com @ 2023-05-29 15:09 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110025
Bug ID: 110025
Summary: ICE with default-argument for template-param with
decltype and auto.
Product: gcc
Version: 13.1.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: jehelset at gmail dot com
Target Milestone: ---
Compiler ICE when using
decltype(auto(variable-template<earlier-template-param>)) as default-argument
of a template-param:
https://godbolt.org/z/M9qrvTj8P
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/110025] ICE with default-argument for template-param with decltype and auto.
2023-05-29 15:09 [Bug c++/110025] New: ICE with default-argument for template-param with decltype and auto jehelset at gmail dot com
@ 2023-05-29 18:09 ` jehelset at gmail dot com
2023-05-30 3:56 ` pinskia at gcc dot gnu.org
` (6 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: jehelset at gmail dot com @ 2023-05-29 18:09 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110025
--- Comment #1 from John Eivind Helset <jehelset at gmail dot com> ---
Some other weirdness related to use of `auto(expr)` in template-arguments:
https://godbolt.org/z/jf64xExTW
Might be a separate bug.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/110025] ICE with default-argument for template-param with decltype and auto.
2023-05-29 15:09 [Bug c++/110025] New: ICE with default-argument for template-param with decltype and auto jehelset at gmail dot com
2023-05-29 18:09 ` [Bug c++/110025] " jehelset at gmail dot com
@ 2023-05-30 3:56 ` pinskia at gcc dot gnu.org
2023-05-30 3:56 ` pinskia at gcc dot gnu.org
` (5 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-05-30 3:56 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110025
--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Created attachment 55200
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=55200&action=edit
testcase 1
Please next time attach the testcases rather than just links to godbolt.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/110025] ICE with default-argument for template-param with decltype and auto.
2023-05-29 15:09 [Bug c++/110025] New: ICE with default-argument for template-param with decltype and auto jehelset at gmail dot com
2023-05-29 18:09 ` [Bug c++/110025] " jehelset at gmail dot com
2023-05-30 3:56 ` pinskia at gcc dot gnu.org
@ 2023-05-30 3:56 ` pinskia at gcc dot gnu.org
2023-05-30 3:59 ` pinskia at gcc dot gnu.org
` (4 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-05-30 3:56 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110025
--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Created attachment 55201
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=55201&action=edit
testcase 2
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/110025] ICE with default-argument for template-param with decltype and auto.
2023-05-29 15:09 [Bug c++/110025] New: ICE with default-argument for template-param with decltype and auto jehelset at gmail dot com
` (2 preceding siblings ...)
2023-05-30 3:56 ` pinskia at gcc dot gnu.org
@ 2023-05-30 3:59 ` pinskia at gcc dot gnu.org
2023-05-30 4:13 ` [Bug c++/110025] [C++23] " pinskia at gcc dot gnu.org
` (3 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-05-30 3:59 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110025
--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Created attachment 55202
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=55202&action=edit
self contained testcase for testcase 2
No headers. -std=c++2b
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/110025] [C++23] ICE with default-argument for template-param with decltype and auto.
2023-05-29 15:09 [Bug c++/110025] New: ICE with default-argument for template-param with decltype and auto jehelset at gmail dot com
` (3 preceding siblings ...)
2023-05-30 3:59 ` pinskia at gcc dot gnu.org
@ 2023-05-30 4:13 ` pinskia at gcc dot gnu.org
2023-05-30 4:13 ` pinskia at gcc dot gnu.org
` (2 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-05-30 4:13 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110025
--- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Created attachment 55203
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=55203&action=edit
reduced self-contained testcase for testcase #1
This removes all of the unneeded code really.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/110025] [C++23] ICE with default-argument for template-param with decltype and auto.
2023-05-29 15:09 [Bug c++/110025] New: ICE with default-argument for template-param with decltype and auto jehelset at gmail dot com
` (4 preceding siblings ...)
2023-05-30 4:13 ` [Bug c++/110025] [C++23] " pinskia at gcc dot gnu.org
@ 2023-05-30 4:13 ` pinskia at gcc dot gnu.org
2023-05-30 9:20 ` jehelset at gmail dot com
2024-03-01 17:51 ` cvs-commit at gcc dot gnu.org
7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-05-30 4:13 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110025
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Ever confirmed|0 |1
Status|UNCONFIRMED |NEW
Keywords| |ice-on-valid-code,
| |rejects-valid
Last reconfirmed| |2023-05-30
--- Comment #6 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Confirmed.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/110025] [C++23] ICE with default-argument for template-param with decltype and auto.
2023-05-29 15:09 [Bug c++/110025] New: ICE with default-argument for template-param with decltype and auto jehelset at gmail dot com
` (5 preceding siblings ...)
2023-05-30 4:13 ` pinskia at gcc dot gnu.org
@ 2023-05-30 9:20 ` jehelset at gmail dot com
2024-03-01 17:51 ` cvs-commit at gcc dot gnu.org
7 siblings, 0 replies; 9+ messages in thread
From: jehelset at gmail dot com @ 2023-05-30 9:20 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110025
--- Comment #7 from John Eivind Helset <jehelset at gmail dot com> ---
(In reply to Andrew Pinski from comment #2)
> Created attachment 55200 [details]
> testcase 1
>
> Please next time attach the testcases rather than just links to godbolt.
Will do! Thanks.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/110025] [C++23] ICE with default-argument for template-param with decltype and auto.
2023-05-29 15:09 [Bug c++/110025] New: ICE with default-argument for template-param with decltype and auto jehelset at gmail dot com
` (6 preceding siblings ...)
2023-05-30 9:20 ` jehelset at gmail dot com
@ 2024-03-01 17:51 ` cvs-commit at gcc dot gnu.org
7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-03-01 17:51 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110025
--- Comment #8 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Patrick Palka <ppalka@gcc.gnu.org>:
https://gcc.gnu.org/g:a6a1920b592b58c38137c5c891b3bbb02b084f38
commit r14-9260-ga6a1920b592b58c38137c5c891b3bbb02b084f38
Author: Patrick Palka <ppalka@redhat.com>
Date: Fri Mar 1 12:50:18 2024 -0500
c++: auto(x) partial substitution [PR110025, PR114138]
In r12-6773-g09845ad7569bac we gave CTAD placeholders a level of 0 and
ensured we never replaced them via tsubst. It turns out that autos
representing an explicit cast need the same treatment and for the same
reason: such autos appear in an expression context and so their level
gets easily messed up after partial substitution, leading to premature
replacement via an incidental tsubst instead of via do_auto_deduction.
This patch fixes this by extending the r12-6773 approach to auto(x).
PR c++/110025
PR c++/114138
gcc/cp/ChangeLog:
* cp-tree.h (make_cast_auto): Declare.
* parser.cc (cp_parser_functional_cast): If the type is an auto,
replace it with a level-less one via make_cast_auto.
* pt.cc (find_parameter_packs_r): Don't treat level-less auto
as a type parameter pack.
(tsubst) <case TEMPLATE_TYPE_PARM>: Generalize CTAD placeholder
auto handling to all level-less autos.
(make_cast_auto): Define.
(do_auto_deduction): Handle replacement of a level-less auto.
gcc/testsuite/ChangeLog:
* g++.dg/cpp23/auto-fncast16.C: New test.
* g++.dg/cpp23/auto-fncast17.C: New test.
* g++.dg/cpp23/auto-fncast18.C: New test.
Reviewed-by: Jason Merrill <jason@redhat.com>
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2024-03-01 17:51 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-29 15:09 [Bug c++/110025] New: ICE with default-argument for template-param with decltype and auto jehelset at gmail dot com
2023-05-29 18:09 ` [Bug c++/110025] " jehelset at gmail dot com
2023-05-30 3:56 ` pinskia at gcc dot gnu.org
2023-05-30 3:56 ` pinskia at gcc dot gnu.org
2023-05-30 3:59 ` pinskia at gcc dot gnu.org
2023-05-30 4:13 ` [Bug c++/110025] [C++23] " pinskia at gcc dot gnu.org
2023-05-30 4:13 ` pinskia at gcc dot gnu.org
2023-05-30 9:20 ` jehelset at gmail dot com
2024-03-01 17:51 ` cvs-commit 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).