https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125698
Bug ID: 125698
Summary: GCC segfaults when compiling self referential concept
Product: gcc
Version: 17.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: [email protected]
Target Milestone: ---
The source code:
```
template <typename T1> struct T2 {
};
template <typename _I1, typename = T2<_I1>> concept indirectly_swappable = ;
iter_swap() (indirectly_swappable<
```
The GCC version:
```
Using built-in specs.
COLLECT_GCC=./gcc/xg++
Target: x86_64-pc-linux-gnu
Configured with: ../configure
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 17.0.0 20260609 (experimental) (GCC)
```
The output:
```
main.cc:3:76: error: expected primary-expression before ‘;’ token
3 | template <typename _I1, typename = T2<_I1>> concept
indirectly_swappable = ;
|
^
main.cc:4:23: error: expected ‘auto’ or ‘decltype(auto)’ after
‘indirectly_swappable’
4 | iter_swap() (indirectly_swappable<
| ^~~~~~~~~~~~~~~~~~~~
xg++: internal compiler error: Segmentation fault signal terminated program
cc1plus
Segmentation fault (core dumped)
```