[LLVMbugs] [Bug 24188] New: clang fails to compile source with unicode literals under -std=gnu99

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Jul 20 05:53:28 PDT 2015


https://llvm.org/bugs/show_bug.cgi?id=24188

            Bug ID: 24188
           Summary: clang fails to compile source with unicode literals
                    under -std=gnu99
           Product: clang
           Version: 3.4
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: jeansaad at ca.ibm.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

clang fails to compile source with unicode literals under -std=gnu99.
gcc allows unicode literals under -std=gnu99 in support of TR 19769.

clang version used was 3.4; however it was tested as far back as 3.2 with same
behavior and possibly goes back a lot further.

### STANDALONE SOURCE:
#include <uchar.h>

int main(void) {
    char16_t c16 = u'\u00F6';
    char32_t c32 = U'\U0010FFFF';
}

### COMPILER INVOCATION:
clang -std=gnu99 -c unicode_literals.c

### EXPECTED OUTPUT:
Successful compile.

### ACTUAL OUTPUT:
unicode_literals.c:4:17: error: use of undeclared identifier 'u'
        char16_t c16 = u'\u00F6';
                       ^
unicode_literals.c:5:17: error: use of undeclared identifier 'U'
        char32_t c32 = U'\U0010FFFF';
                       ^
2 errors generated.

### clang -v OUTPUT:
Ubuntu clang version 3.4-1ubuntu3 (tags/RELEASE_34/final) (based on LLVM 3.4)
Target: x86_64-pc-linux-gnu
Thread model: posix

### GCC INVOCATION:
gcc -std=gnu99 -c unicode_literals.c

## gcc -v OUTPUT:
Thread model: posix
gcc version 4.8.4 (Ubuntu 4.8.4-2ubuntu1~14.04)

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20150720/caf06252/attachment.html>


More information about the llvm-bugs mailing list