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++/17022] New: Behavior of out-of-range enums


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


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