зеркало из https://github.com/microsoft/clang-1.git
Fix brace-enclosed string initializers for char arrays. From pr2079,
ahtough I had the fix in my tree previously. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47439 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
3513e138cc
Коммит
4d1c018607
|
@ -69,9 +69,12 @@ public:
|
|||
|
||||
llvm::Constant *EmitArrayInitialization(InitListExpr *ILE,
|
||||
const llvm::ArrayType *AType) {
|
||||
|
||||
std::vector<llvm::Constant*> Elts;
|
||||
unsigned NumInitElements = ILE->getNumInits();
|
||||
std::vector<llvm::Constant*> Elts;
|
||||
unsigned NumInitElements = ILE->getNumInits();
|
||||
// FIXME: Check for wide strings
|
||||
if (NumInitElements > 0 && isa<StringLiteral>(ILE->getInit(0)) &&
|
||||
ILE->getType()->getAsArrayType()->getElementType()->isCharType())
|
||||
return Visit(ILE->getInit(0));
|
||||
const llvm::Type *ElemTy = AType->getElementType();
|
||||
unsigned NumElements = AType->getNumElements();
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче