This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/53892] New: Invalid "duplicate case value" for C++11 utf-16 char literals
- From: "arnetheduck at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 08 Jul 2012 11:15:37 +0000
- Subject: [Bug c++/53892] New: Invalid "duplicate case value" for C++11 utf-16 char literals
- Auto-submitted: auto-generated
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.