Skip to content

fix forward declared enums - #456

Open
aalmkainzi wants to merge 8 commits into
thradams:mainfrom
aalmkainzi:fix-fwd-enum
Open

fix forward declared enums#456
aalmkainzi wants to merge 8 commits into
thradams:mainfrom
aalmkainzi:fix-fwd-enum

Conversation

@aalmkainzi

Copy link
Copy Markdown
Contributor

mimics gcc/clang behavior:

enum E a; // error: incomplete enum

but this is ok:

enum E a;

enum E { A };

Also fixed cake not giving diagnosis with functions defs that contain incomplete types:

void foo(struct S) {}

the above code, cake used to error with no message, now gives:

error 740: function has incomplete parameter type
 1 |void foo(struct S) {}
   |     ~~~

however, this is allowed, as it should be:

enum E : int;
void foo(enum E);

thradams added a commit that referenced this pull request Aug 15, 2026
fix forward declared enums - #456
with fixes
@thradams

Copy link
Copy Markdown
Owner

I added the fixes manually

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants