| ... | @@ -3434,7 +3434,12 @@ static AstNode *resolve_enum_decl(Context *c, const EnumDecl *enum_decl) { | ... | @@ -3434,7 +3434,12 @@ static AstNode *resolve_enum_decl(Context *c, const EnumDecl *enum_decl) { |
| 3434 | AstNode *enum_node = trans_create_node(c, NodeTypeContainerDecl); | 3434 | AstNode *enum_node = trans_create_node(c, NodeTypeContainerDecl); |
| 3435 | enum_node->data.container_decl.kind = ContainerKindEnum; | 3435 | enum_node->data.container_decl.kind = ContainerKindEnum; |
| 3436 | enum_node->data.container_decl.layout = ContainerLayoutExtern; | 3436 | enum_node->data.container_decl.layout = ContainerLayoutExtern; |
| 3437 | if (!c_is_builtin_type(c, enum_decl->getIntegerType(), BuiltinType::UInt)) { | 3437 | // TODO only emit this tag type if the enum tag type is not the default. |
| | 3438 | // I don't know what the default is, need to figure out how clang is deciding. |
| | 3439 | // it appears to at least be different across gcc/msvc |
| | 3440 | if (!c_is_builtin_type(c, enum_decl->getIntegerType(), BuiltinType::UInt) && |
| | 3441 | !c_is_builtin_type(c, enum_decl->getIntegerType(), BuiltinType::Int)) |
| | 3442 | { |
| 3438 | enum_node->data.container_decl.init_arg_expr = tag_int_type; | 3443 | enum_node->data.container_decl.init_arg_expr = tag_int_type; |
| 3439 | } | 3444 | } |
| 3440 | | 3445 | |