d: Fix internal compiler error: in build_complex, at tree.c:2358
authorIain Buclaw <ibuclaw@gdcproject.org>
Mon, 21 Mar 2022 18:47:50 +0000 (19:47 +0100)
committerIain Buclaw <ibuclaw@gdcproject.org>
Mon, 21 Mar 2022 18:51:51 +0000 (19:51 +0100)
commit1dd51373a82408361068e130a84caa888ef0d2b3
tree0e64a8d6bad52fc5b6d4ec58dbf018bcf0631d8d
parentfbdaa58162ee4189f441b75170af89215465d189
d: Fix internal compiler error: in build_complex, at tree.c:2358

The conversion from the special _Complex enum to native complex used
build_complex, however the input value isn't necessarily a literal.

PR d/105004

gcc/d/ChangeLog:

* d-codegen.cc (build_struct_literal): Use complex_expr to build
complex expressions from __c_complex types.

gcc/testsuite/ChangeLog:

* gdc.dg/pr105004.d: New test.
gcc/d/d-codegen.cc
gcc/testsuite/gdc.dg/pr105004.d [new file with mode: 0644]