This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/61584] What defines std::underlying_type?


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61584

--- Comment #2 from David Krauss <potswa at mac dot com> ---
C "compatible type" determines integer conversion rank (C11 Â6.3.1.1). C++
fixes the rank by a heuristic which the implementation cannot decide (C++11
Â4.5/3).

Currently, enum promotions are incompatible between C and C++ modes.
Furthermore, when C++ requires promotion to signed int but the underlying type
is unsigned int, integer overflow may occur.

I think this adds up to a bug and the C++ behavior should get its own bullet at
the end of that manual page.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]