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
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.
--- /dev/null
+// RUN: %clang_cc1 -rewrite-objc %s -o -
+
+@class NSArray;
+int main() {
+ NSArray *foo;
+ for (Class c in foo) { }
+}