The bug happens only for enum types with a fixed underlying type. The
existing code tries to create another type based on it's precision by
calling c_common_type_for_size(). For the precision value of an unsigned
long long type, the call to c_common_type_for_size() returns an unsigned
long type and this causes compilation errors later on. The fix is to
simply use the fixed underlying type of the enum instead of creating a
new one.
Mukesh
On 10/18/2017 1:10 PM, Nathan Sidwell wrote:
On 10/18/2017 12:17 PM, Mukesh Kapoor wrote:
On 10/9/2017 12:20 PM, Mukesh Kapoor wrote:
Hi,
This patch fixes https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82307.
For an unscoped enum with a fixed underlying type, the function
type_promotes_to() does not always return the same type as the
underlying type. The fix is to use the underlying type of the enum
instead of creating a new one by calling c_common_type_for_size().
The diff looks wrong. Just before the changed piece it (attempts to)
deal with enum types. Why is that failing?
nathan