diff options
| author | Fariborz Jahanian <fjahanian@apple.com> | 2010-02-03 21:29:28 +0000 |
|---|---|---|
| committer | Fariborz Jahanian <fjahanian@apple.com> | 2010-02-03 21:29:28 +0000 |
| commit | 80c54b05a0b4790a54556a80587b95b6fc4b5c97 (patch) | |
| tree | 89dc31aba9ff1aa096ced389b50191e385c2d295 /clang | |
| parent | f914be06d28098f526267d82adc627e1a1d53771 (diff) | |
| download | bcm5719-llvm-80c54b05a0b4790a54556a80587b95b6fc4b5c97.tar.gz bcm5719-llvm-80c54b05a0b4790a54556a80587b95b6fc4b5c97.zip | |
Fix more rewriting of protocol-quialified 'id' type.
(Fixes radar 7607413).
llvm-svn: 95257
Diffstat (limited to 'clang')
| -rw-r--r-- | clang/lib/Frontend/RewriteObjC.cpp | 2 | ||||
| -rw-r--r-- | clang/test/Rewriter/rewrite-protocol-qualified.mm | 20 |
2 files changed, 22 insertions, 0 deletions
diff --git a/clang/lib/Frontend/RewriteObjC.cpp b/clang/lib/Frontend/RewriteObjC.cpp index 980c96ad17d..9ec28bb6d4e 100644 --- a/clang/lib/Frontend/RewriteObjC.cpp +++ b/clang/lib/Frontend/RewriteObjC.cpp @@ -1995,6 +1995,8 @@ static void scanToNextArgument(const char *&argRef) { } bool RewriteObjC::needToScanForQualifiers(QualType T) { + if (T->isObjCQualifiedIdType()) + return true; if (const PointerType *PT = T->getAs<PointerType>()) { if (PT->getPointeeType()->isObjCQualifiedIdType()) return true; diff --git a/clang/test/Rewriter/rewrite-protocol-qualified.mm b/clang/test/Rewriter/rewrite-protocol-qualified.mm index e93ddbba277..e91c3db8616 100644 --- a/clang/test/Rewriter/rewrite-protocol-qualified.mm +++ b/clang/test/Rewriter/rewrite-protocol-qualified.mm @@ -16,6 +16,26 @@ } @end +// radar 7607413 +@protocol Proto1, Proto2; + +@protocol Proto +@end + +unsigned char func(id<Proto1, Proto2> inProxy); + +id bar(id); + +void f() { + id a; + id b = bar((id <Proto>)a); +} + // CHECK-LP: NSConnection /*<NSPortDelegate>*/ *conn = 0; // CHECK-LP: id /*<NSPortDelegate>*/ *idc = 0; + +// CHECK-LP: func(id/*<Proto1, Proto2>*/ inProxy); + +// CHECK-LP: bar((id /*<Proto>*/)a); + |

