[Bug c/53661] New: Wrong narrowing conversion warning with -std=c++11

tmsriram at google dot com gcc-bugzilla@gcc.gnu.org
Wed Jun 13 20:42:00 GMT 2012


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53661

             Bug #: 53661
           Summary: Wrong narrowing conversion warning with -std=c++11
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: tmsriram@google.com


test.cc

enum Code {
  SUCCESS = 0
};

Code a;

int r[] = {a};

$ g++ test.cc -c -std=c++11
test.cc:7:13:warning: narrowing conversion of ‘a’ from ‘Code’ to ‘int’ inside {
} [-Wnarrowing]
 int r[] = {a};



More information about the Gcc-bugs mailing list