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++/53892] New: Invalid "duplicate case value" for C++11 utf-16 char literals


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

             Bug #: 53892
           Summary: Invalid "duplicate case value" for C++11 utf-16 char
                    literals
    Classification: Unclassified
           Product: gcc
           Version: 4.7.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: arnetheduck@gmail.com


In the following C++ function:

void f(char16_t c) {
    switch(c) {
    case u'\u0000':
    case u'\u0001':
    break;
    }
}

G++, when invoked with "g++ -std=gnu++11 test.cpp" gives the following
unexpected error message:

test.cpp: In function âvoid f(char16_t)â:
test.cpp:5:5: error: duplicate case value
test.cpp:4:5: error: previously used here

Lines 4 & 5 are the two case values. 

Changing either of the values to u'\u0002' makes the code compile correctly.


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