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: [email protected]
          Reporter: [email protected]
                CC: [email protected]
    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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to