Skip to content

importC: complex fails when passing real and imaginary initializers for non windows systems. #22259

@Emmankoko

Description

@Emmankoko
#include <complex.h>
#include <stdio.h>

void foo()
{
    _Complex double x = 1 + 1.0if;
    return;
}


int main()
{
    return 0;
}
zcomplex.c(8): Error: cannot implicitly convert expression `_Complex(0.0F, 1.0F).opBinaryRight(1)` of type `_Complex!float` to `_Complex!double`
zcomplex.c(8):        `x = _Complex(0.0F, 1.0F).opBinaryRight(1)` is the first assignment of `x` therefore it represents its initialization
zcomplex.c(8):        `opAssign` methods are not used for initialization, but for subsequent assignments

`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions