r179879 - Emit the underlying type in the debug info for all kinds of fixed enums

Stephan Tolksdorf st at quanttec.com
Sun May 11 10:30:55 PDT 2014


David Blaikie wrote:
> Just to come back to this. It's not just a question of bloat, it's
> just incorrect to put DW_AT_enum_class on an enum that's not an enum
> class... classes with fixed underlying type aren't necessarily enum
> classes:
>
>    enum x : int { }; // fixed underlying type, but not an enum class,
> should not have DW_AT_enum_class
>
>    enum class x { }; // no fixed underlying type, but is an enum class

[dcl.enum]p5 of the C++ standard states
"The underlying type can be explicitly specified using enum-base; if not 
explicitly specified, the underlying type of a scoped enumeration type 
is int. In these cases, the underlying type is said to be
fixed."

I read this as saying that the underlying type of a scoped enumeration 
is always "fixed".

- Stephan



More information about the cfe-commits mailing list