Fariborz Jahanian | f2b4f7b | 2012-01-12 22:12:08 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -fsyntax-only -verify %s |
| 2 | // RUN: %clang_cc1 -x objective-c++ -fsyntax-only -verify %s |
Andy Gibbs | 8e8fb3b | 2012-10-19 12:44:48 +0000 | [diff] [blame] | 3 | // expected-no-diagnostics |
Fariborz Jahanian | f2b4f7b | 2012-01-12 22:12:08 +0000 | [diff] [blame] | 4 | // rdar://10667659 |
| 5 | |
| 6 | @protocol NSCopying @end |
| 7 | |
| 8 | @interface NSString <NSCopying> |
| 9 | @end |
| 10 | |
| 11 | void takeId(id test) {} |
| 12 | |
| 13 | void takeCopyableId(id<NSCopying> test) {} |
| 14 | |
| 15 | id<NSCopying> Test () { |
| 16 | NSString const *constantString = @"Test"; |
| 17 | takeId(constantString); |
| 18 | takeCopyableId(constantString); |
| 19 | id ID = constantString; |
| 20 | id<NSCopying> IDQNSCopying = constantString; |
| 21 | return constantString; |
| 22 | } |