mirror of
https://github.com/ziglang/zig.git
synced 2026-01-06 21:43:25 +00:00
translate-c: ensure scoped (non-public) enum constants are used
This commit is contained in:
parent
3259532080
commit
29314b64bd
@ -1137,8 +1137,10 @@ fn transEnumDecl(c: *Context, scope: *Scope, enum_decl: *const clang.EnumDecl) E
|
||||
});
|
||||
if (toplevel)
|
||||
try addTopLevelDecl(c, enum_val_name, enum_const_def)
|
||||
else
|
||||
else {
|
||||
try scope.appendNode(enum_const_def);
|
||||
try bs.discardVariable(c, enum_val_name);
|
||||
}
|
||||
}
|
||||
|
||||
const int_type = enum_decl.getIntegerType();
|
||||
@ -1177,6 +1179,7 @@ fn transEnumDecl(c: *Context, scope: *Scope, enum_decl: *const clang.EnumDecl) E
|
||||
try c.alias_list.append(.{ .alias = bare_name, .name = name });
|
||||
} else {
|
||||
try scope.appendNode(Node.initPayload(&payload.base));
|
||||
try bs.discardVariable(c, name);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user