This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/17022] New: Behavior of out-of-range enums
- From: "igodard at pacbell dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 13 Aug 2004 22:59:33 -0000
- Subject: [Bug c++/17022] New: Behavior of out-of-range enums
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
I'm pretty sure that the behavior of:
#include <iostream>
enum A{a,b,c};
enum B{d,e,f,g};
int main() {
std::cerr << A(3) << ":" << B(4) << "\n";
return 0;
}
is implementation defined by the standard, but the actual result:
~/ootbc/members/members/sweetie/test/src$ a.out
3:0
is quite startling. Are you sure that this is what you want the implementation to define?
Ivan
--
Summary: Behavior of out-of-range enums
Product: gcc
Version: 3.4.0
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: igodard at pacbell dot net
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17022