forked from OSchip/llvm-project
Fix rewriting for forward class declaration.
(fixes radar 6969189). llvm-svn: 93201
This commit is contained in:
parent
a6b1356cf9
commit
1c2cb6df9e
|
@ -787,9 +787,17 @@ void RewriteObjC::RewriteForwardClassDecl(ObjCClassDecl *ClassDecl) {
|
|||
// as the class. As a convenience, we include the original declaration
|
||||
// as a comment.
|
||||
std::string typedefString;
|
||||
typedefString += "// ";
|
||||
typedefString.append(startBuf, semiPtr-startBuf+1);
|
||||
typedefString += "\n";
|
||||
typedefString += "// @class ";
|
||||
for (ObjCClassDecl::iterator I = ClassDecl->begin(), E = ClassDecl->end();
|
||||
I != E; ++I) {
|
||||
ObjCInterfaceDecl *ForwardDecl = I->getInterface();
|
||||
typedefString += ForwardDecl->getNameAsString();
|
||||
if (I+1 != E)
|
||||
typedefString += ", ";
|
||||
else
|
||||
typedefString += ";\n";
|
||||
}
|
||||
|
||||
for (ObjCClassDecl::iterator I = ClassDecl->begin(), E = ClassDecl->end();
|
||||
I != E; ++I) {
|
||||
ObjCInterfaceDecl *ForwardDecl = I->getInterface();
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
// RUN: %clang_cc1 -rewrite-objc -o - %s
|
||||
// rdar://6969189
|
||||
|
||||
@class XX;
|
||||
@class YY, ZZ, QQ;
|
||||
@class ISyncClient, SMSession, ISyncManager, ISyncSession, SMDataclassInfo, SMClientInfo,
|
||||
DMCConfiguration, DMCStatusEntry;
|
||||
|
Loading…
Reference in New Issue