Skip to content

translate-c regression: __attribute__ in typedef #213

@GalaxyShard

Description

@GalaxyShard

Zig Version

0.16.0-dev.747+493ad58ff

Steps to Reproduce and Observed Behavior

$ printf "typedef struct A {} A, __attribute__((deprecated)) B;\n" > /tmp/a.h
$ zig translate-c /tmp/a.h

results in error:

/tmp/a.h:1:24: error: expected identifier or '('
typedef struct A {} A, __attribute__((deprecated)) B;
                       ^
/tmp/a.h:1:24: error: expected ';', found '__attribute__'
typedef struct A {} A, __attribute__((deprecated)) B;
                       ^

Expected Behavior

Aro-based translate-c should correctly parse this code like clang did.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions