[Bug c++/118192] ICE: in build_data_member_initialization, at cp/constexpr.cc:453
pinskia at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Sun Dec 29 22:54:01 GMT 2024
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118192
--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Andrew Pinski from comment #3)
> Better reduced testcase:
> ```
> template<int> struct A
> {
> int i{};
> A() = delete;
> constexpr A(int) : A() {}
> };
>
> constexpr A<0> a{0};
> ```
Sorry:
```
template<int> struct A
{
int i{};
A() = delete;
constexpr A(int) : A{} {}
};
constexpr A<0> a{0};
```
The {} for the delegated constructor is needed to get the ICE before GCC 7.
More information about the Gcc-bugs
mailing list