Always expose underlying type of enum
This commit is contained in:
parent
c3d1d97892
commit
251e9abf5f
4 changed files with 30 additions and 25 deletions
|
|
@ -205,10 +205,10 @@ namespace
|
|||
if (e.is_scoped())
|
||||
output << whitespace << keyword("class");
|
||||
output << whitespace << identifier(e.name());
|
||||
if (e.underlying_type())
|
||||
if (e.has_explicit_type())
|
||||
{
|
||||
output << newl << punctuation(":");
|
||||
detail::write_type(output, e.underlying_type().value(), "");
|
||||
detail::write_type(output, e.underlying_type(), "");
|
||||
}
|
||||
|
||||
if (e.is_definition())
|
||||
|
|
|
|||
|
|
@ -53,12 +53,11 @@ namespace
|
|||
detail::skip_attribute(stream);
|
||||
auto& name = stream.get().value();
|
||||
|
||||
std::unique_ptr<cpp_type> type;
|
||||
if (detail::skip_if(stream, ":"))
|
||||
// parse type, explictly given one
|
||||
type = detail::parse_type(context, cur, clang_getEnumDeclIntegerType(cur));
|
||||
// parse type
|
||||
auto type = detail::parse_type(context, cur, clang_getEnumDeclIntegerType(cur));
|
||||
auto type_given = detail::skip_if(stream, ":");
|
||||
|
||||
return cpp_enum::builder(name.c_str(), scoped, std::move(type));
|
||||
return cpp_enum::builder(name.c_str(), scoped, std::move(type), type_given);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue