зеркало из https://github.com/microsoft/clang-1.git
clang ObjC rewriter: generated code used in "for (x in y)" loop uses
incorrect cast, causing compile error (fixes radar 7342867). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92986 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
a1d7d627a4
Коммит
65b0aa5d39
|
@ -1483,14 +1483,18 @@ Stmt *RewriteObjC::RewriteObjCForCollectionStmt(ObjCForCollectionStmt *S,
|
|||
SynthCountByEnumWithState(buf);
|
||||
buf += ");\n\t";
|
||||
buf += elementName;
|
||||
buf += " = ((id)0);\n\t";
|
||||
buf += " = ((";
|
||||
buf += elementTypeAsString;
|
||||
buf += ")0);\n\t";
|
||||
buf += "__break_label_";
|
||||
buf += utostr(ObjCBcLabelNo.back());
|
||||
buf += ": ;\n\t";
|
||||
buf += "}\n\t";
|
||||
buf += "else\n\t\t";
|
||||
buf += elementName;
|
||||
buf += " = ((id)0);\n";
|
||||
buf += " = ((";
|
||||
buf += elementTypeAsString;
|
||||
buf += ")0);\n\t";
|
||||
buf += "}\n";
|
||||
|
||||
// Insert all these *after* the statement body.
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
// RUN: %clang_cc1 -rewrite-objc %s -o -
|
||||
|
||||
@class NSArray;
|
||||
int main() {
|
||||
NSArray *foo;
|
||||
for (Class c in foo) { }
|
||||
}
|
Загрузка…
Ссылка в новой задаче