Bug 118078 - [12/13/14/15 Regression] GCC crashes on incorrect code with -std=c++20 since r10-4719
Summary: [12/13/14/15 Regression] GCC crashes on incorrect code with -std=c++20 since ...
Status: ASSIGNED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 15.0
: P2 normal
Target Milestone: 12.5
Assignee: Simon Martin
URL:
Keywords: ice-on-invalid-code
Depends on: 116108
Blocks:
  Show dependency treegraph
 
Reported: 2024-12-17 09:31 UTC by Jakub Jelinek
Modified: 2025-01-03 09:52 UTC (History)
4 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2024-12-17 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jakub Jelinek 2024-12-17 09:31:37 UTC
+++ This bug was initially created as a clone of Bug #116108 +++

template <class T>
struct S { struct U { S s; } u; };
S t{2};

(or cv qualified versions thereof somewhere) or say
template <class T>
struct S { struct U { struct V { const struct W { const S s; } w; } v; } u; };
S t{2};

still ICE, looking just at currently_open_class isn't enough, there can be many open classes at the same time.

All this still started with r10-4719-g9b41ebbcdf9e33285a0eebeb7c841afe20e4a7c1
Comment 1 Jakub Jelinek 2024-12-17 09:38:43 UTC
Do we need
-                     && same_type_p (TYPE_MAIN_VARIANT (type),
-                                     current_class_type))
+                     && currently_open_class (TYPE_MAIN_VARIANT (type))
or something else?
Comment 2 Simon Martin 2024-12-19 20:36:06 UTC
Working on it.
Comment 3 Simon Martin 2024-12-19 21:30:41 UTC
Thanks for the report. I'm currently testing a patch that leverages TYPE_BEING_DEFINED instead or looking at current_class_type.
Comment 4 Simon Martin 2025-01-03 09:52:06 UTC
Patch submitted in https://gcc.gnu.org/pipermail/gcc-patches/2024-December/672144.html