arocc icon indicating copy to clipboard operation
arocc copied to clipboard

Braced init of complex type with different complex type not handled same as in Clang

Open Vexu opened this issue 7 months ago • 0 comments

const _Complex double a = {1, 2};
const _Complex float b = {a};
_Static_assert(__imag b == 2, ""); // fails because the imaginary part is left default initialized to 0
const _Complex float c = {a, 4};
_Static_assert(__imag c == 4, "");

Vexu avatar May 29 '25 11:05 Vexu