This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/61584] What defines std::underlying_type?
- From: "potswa at mac dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 23 Jun 2014 07:28:13 +0000
- Subject: [Bug c++/61584] What defines std::underlying_type?
- Auto-submitted: auto-generated
- References: <bug-61584-4 at http dot gcc dot gnu dot org/bugzilla/>
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.