[Issue 22362] New: ImportC: error parsing compound literal with more than one value at function scope.

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Oct 6 19:29:23 UTC 2021


https://issues.dlang.org/show_bug.cgi?id=22362

          Issue ID: 22362
           Summary: ImportC: error parsing compound literal with more than
                    one value at function scope.
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: dave287091 at gmail.com

// compound.c
typedef struct Foo {
    int x, y;
} Foo;

Foo gfoo = (Foo){0, 1}; // no error
int main(int argc, char** argv){
    Foo foo1 = (Foo){0}; // no error
    Foo foo2 = (Foo){0, 1}; // error here
}


compound.c(9): Error: found `=` when expecting `;` or `=`, did you mean `Foo
foo2 = (`?
compound.c(9): Error: found `=` instead of statement
compound.c(9): Error: identifier or `(` expected
compound.c(10): Error: identifier or `(` expected

--


More information about the Digitalmars-d-bugs mailing list