зеркало из https://github.com/microsoft/clang-1.git
Fix rewriting for forward class declaration.
(fixes radar 6969189). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93201 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
277d280c20
Коммит
91fbd12d8b
|
@ -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;
|
||||
|
Загрузка…
Ссылка в новой задаче