diff --git a/src/aro/Parser.zig b/src/aro/Parser.zig index 3e475316..e877594c 100644 --- a/src/aro/Parser.zig +++ b/src/aro/Parser.zig @@ -3244,6 +3244,9 @@ fn complexInitializer(p: *Parser, init_ty: Type) Error!Result { assert(init_ty.isComplex()); const real_ty = init_ty.makeReal(); + if (real_ty.isInt()) { + return p.todo("Complex integer initializers"); + } const l_brace = p.tok_i; p.tok_i += 1; try p.errTok(.complex_component_init, l_brace); diff --git a/test/cases/ast/complex init.c b/test/cases/ast/complex init.c index 8fe34af0..90174678 100644 --- a/test/cases/ast/complex init.c +++ b/test/cases/ast/complex init.c @@ -16,13 +16,6 @@ fn_def: 'fn () void' float_literal: 'float' (value: 1) float_literal: 'float' (value: 2) - var: '_Complex int' - name: ci - init: - array_init_expr_two: '_Complex int' - int_literal: 'int' (value: 1) - int_literal: 'int' (value: 2) - assign_expr: '_Complex double' lhs: decl_ref_expr: '_Complex double' lvalue diff --git a/test/cases/complex init.c b/test/cases/complex init.c index 21284b92..013d1e73 100644 --- a/test/cases/complex init.c +++ b/test/cases/complex init.c @@ -1,7 +1,7 @@ void foo(void) { _Complex double cd = { 1.0, 2.0 }; _Complex float cf = { 1.0f, 2.0f }; - _Complex int ci = {1, 2}; + // _Complex int ci = {1, 2}; // TODO: complx integer initializer cd = __builtin_complex(1.0, 2.0); cf = __builtin_complex(1.0f, 2.0f);