Skip to content

Commit d0d2bd5

Browse files
author
Fariborz Jahanian
committed
Fixed a bug exposed by referencing an ivar field using component reference syntax.
llvm-svn: 44553
1 parent 68fcff9 commit d0d2bd5

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

clang/Driver/RewriteTest.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -593,7 +593,9 @@ void RewriteTest::RewriteInterfaceDecl(ObjcInterfaceDecl *ClassDecl) {
593593
ResultStr += "#define _REWRITER_typedef_";
594594
ResultStr += ClassDecl->getName();
595595
ResultStr += "\n";
596-
ResultStr += "typedef struct objc_object ";
596+
ResultStr += "typedef struct ";
597+
ResultStr += ClassDecl->getName();
598+
ResultStr += " ";
597599
ResultStr += ClassDecl->getName();
598600
ResultStr += ";\n#endif\n";
599601

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// RUN: clang -rewrite-test %s | clang
2+
3+
#include <objc/objc.h>
4+
5+
@interface MyDerived
6+
{
7+
@public
8+
int IVAR;
9+
}
10+
@end
11+
12+
MyDerived *pd;
13+
int main() {
14+
return pd->IVAR;
15+
}
16+
17+

0 commit comments

Comments
 (0)