http://llvm.org/bugs/show_bug.cgi?id=12226
Bug #: 12226
Summary: 'expected relocatable expression' with unsigned char
array initialized from string literal
Product: clang
Version: trunk
Platform: PC
OS/Version: Linux
Status: NEW
Severity: normal
Priority: P
Component: C++0x
AssignedTo: [email protected]
ReportedBy: [email protected]
CC: [email protected], [email protected]
Classification: Unclassified
Steps to reproduce:
$ echo 'static const unsigned char array[] = { "a" };' >a.cpp
$ clang++ -std=c++11 a.cpp
fatal error: error in backend: expected relocatable expression
$ clang++ --version
SUSE Linux clang version 3.1 (trunk 152441) (based on LLVM 3.1svn)
Target: x86_64-unknown-linux-gnu
Thread model: posix
The problem goes away if not compiling in C+11 mode or if the array is of plain
char type instead of unsigned char.
Even if the code is actually invalid (I can't tell), at least a proper error
message should be given.
--
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- 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