mc-imperial / dredd

Framework for evaluating C/C++ compiler testing tools
Apache License 2.0
11 stars 3 forks source link

Dredd mutates variables that should have a constant initializer #235

Closed JamesLee-Jones closed 2 months ago

JamesLee-Jones commented 3 months ago

Dredd still mutates some forms of variables that should have a constant initializer. This is demonstrated when applying Dredd to the following example:

int main() {
  [[clang::require_constant_initialization]] static int x = __dredd_replace_expr_int_zero(0, 0);
}

This gives:

// Dredd Prelude ...
int main() {
  [[clang::require_constant_initialization]] static int x = __dredd_replace_expr_int_zero(0, 0);
}

Although Dredd doesn't currently support C++ 20, I suspect the same issue would arise with constinit.