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: unassig...@gcc.gnu.org
        ReportedBy: arnethed...@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.

Reply via email to