https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96994
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jakub at gcc dot gnu.org
--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Testcase without includes:
struct A { consteval A () { i = 1; } int i = 0; };
struct B { constexpr B () { i = 1; } int i = 0; };
A const a;
constexpr A b;
B const c;
A constinit d;
static_assert (b.i == 1);
int
main()
{
if (a.i != 1 || c.i != 1 || d.i != 1)
__builtin_abort ();
}
I wonder if we shouldn't treat variables with consteval ctors like if
constinit, which as the testcase shows works fine.