public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/113389] New: ICE when explicit object parameter is not declared as the first parameter
@ 2024-01-14 17:14 cooky.ykooc922 at gmail dot com
2024-01-15 18:47 ` [Bug c++/113389] " mpolacek at gcc dot gnu.org
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: cooky.ykooc922 at gmail dot com @ 2024-01-14 17:14 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113389
Bug ID: 113389
Summary: ICE when explicit object parameter is not declared as
the first parameter
Product: gcc
Version: 14.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: cooky.ykooc922 at gmail dot com
Target Milestone: ---
Although it is obviously an error, it causes ICE:
struct A {
void foo(A, this A);
};
compiler output:
<source>:3:17: error: Only the first parameter of a member function can be
declared as an explicit object parameter
3 | void foo(A, this A);
| ^~~~~~
<source>:3:23: internal compiler error: Segmentation fault
3 | void foo(A, this A);
| ^
0x2640d5c internal_error(char const*, ...)
???:0
0xa78793 perform_implicit_conversion_flags(tree_node*, tree_node*, int, int)
???:0
0xb18083 check_default_argument(tree_node*, tree_node*, int)
???:0
0xb1861f grokparms(tree_node*, tree_node**)
???:0
0xb2caa1 grokdeclarator(cp_declarator const*, cp_decl_specifier_seq*,
decl_context, int, tree_node**)
???:0
0xb50ff3 grokfield(cp_declarator const*, cp_decl_specifier_seq*, tree_node*,
bool, tree_node*, tree_node*)
???:0
0xc5214a c_parse_file()
???:0
0xda5b49 c_common_parse_file()
???:0
godbolt link with -std=c++23: https://godbolt.org/z/Mxefo3nj6
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/113389] ICE when explicit object parameter is not declared as the first parameter
2024-01-14 17:14 [Bug c++/113389] New: ICE when explicit object parameter is not declared as the first parameter cooky.ykooc922 at gmail dot com
@ 2024-01-15 18:47 ` mpolacek at gcc dot gnu.org
2024-01-17 23:23 ` mpolacek at gcc dot gnu.org
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2024-01-15 18:47 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113389
Marek Polacek <mpolacek at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |mpolacek at gcc dot gnu.org
Ever confirmed|0 |1
Status|UNCONFIRMED |NEW
Last reconfirmed| |2024-01-15
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/113389] ICE when explicit object parameter is not declared as the first parameter
2024-01-14 17:14 [Bug c++/113389] New: ICE when explicit object parameter is not declared as the first parameter cooky.ykooc922 at gmail dot com
2024-01-15 18:47 ` [Bug c++/113389] " mpolacek at gcc dot gnu.org
@ 2024-01-17 23:23 ` mpolacek at gcc dot gnu.org
2024-01-18 14:12 ` cvs-commit at gcc dot gnu.org
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2024-01-17 23:23 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113389
Marek Polacek <mpolacek at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
Assignee|unassigned at gcc dot gnu.org |mpolacek at gcc dot gnu.org
--- Comment #1 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
I have a patch.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/113389] ICE when explicit object parameter is not declared as the first parameter
2024-01-14 17:14 [Bug c++/113389] New: ICE when explicit object parameter is not declared as the first parameter cooky.ykooc922 at gmail dot com
2024-01-15 18:47 ` [Bug c++/113389] " mpolacek at gcc dot gnu.org
2024-01-17 23:23 ` mpolacek at gcc dot gnu.org
@ 2024-01-18 14:12 ` cvs-commit at gcc dot gnu.org
2024-01-18 15:01 ` mpolacek at gcc dot gnu.org
2024-01-20 17:09 ` pinskia at gcc dot gnu.org
4 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-01-18 14:12 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113389
--- Comment #2 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The trunk branch has been updated by Marek Polacek <mpolacek@gcc.gnu.org>:
https://gcc.gnu.org/g:9840e0be78150b0ef6e29975a6244698d5a5580c
commit r14-8239-g9840e0be78150b0ef6e29975a6244698d5a5580c
Author: Marek Polacek <polacek@redhat.com>
Date: Wed Jan 17 19:16:32 2024 -0500
c++: ICE when xobj is not the first parm [PR113389]
In grokdeclarator/cdk_function the comment says that the find_xobj_parm
lambda clears TREE_PURPOSE so that we can correctly detect an xobj that
is not the first parameter. That's all good, but we should also clear
the TREE_PURPOSE once we've given the error, otherwise we crash later in
check_default_argument because the 'this' TREE_PURPOSE lacks a type.
PR c++/113389
gcc/cp/ChangeLog:
* decl.cc (grokdeclarator) <case cdk_function>: Set TREE_PURPOSE to
NULL_TREE when emitting an error.
gcc/testsuite/ChangeLog:
* g++.dg/cpp23/explicit-obj-diagnostics10.C: New test.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/113389] ICE when explicit object parameter is not declared as the first parameter
2024-01-14 17:14 [Bug c++/113389] New: ICE when explicit object parameter is not declared as the first parameter cooky.ykooc922 at gmail dot com
` (2 preceding siblings ...)
2024-01-18 14:12 ` cvs-commit at gcc dot gnu.org
@ 2024-01-18 15:01 ` mpolacek at gcc dot gnu.org
2024-01-20 17:09 ` pinskia at gcc dot gnu.org
4 siblings, 0 replies; 6+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2024-01-18 15:01 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113389
Marek Polacek <mpolacek at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution|--- |FIXED
--- Comment #3 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Fixed.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/113389] ICE when explicit object parameter is not declared as the first parameter
2024-01-14 17:14 [Bug c++/113389] New: ICE when explicit object parameter is not declared as the first parameter cooky.ykooc922 at gmail dot com
` (3 preceding siblings ...)
2024-01-18 15:01 ` mpolacek at gcc dot gnu.org
@ 2024-01-20 17:09 ` pinskia at gcc dot gnu.org
4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-01-20 17:09 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113389
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|--- |14.0
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2024-01-20 17:09 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-14 17:14 [Bug c++/113389] New: ICE when explicit object parameter is not declared as the first parameter cooky.ykooc922 at gmail dot com
2024-01-15 18:47 ` [Bug c++/113389] " mpolacek at gcc dot gnu.org
2024-01-17 23:23 ` mpolacek at gcc dot gnu.org
2024-01-18 14:12 ` cvs-commit at gcc dot gnu.org
2024-01-18 15:01 ` mpolacek at gcc dot gnu.org
2024-01-20 17:09 ` pinskia 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).