2012-01-13 06:12:08 +08:00
|
|
|
// RUN: %clang_cc1 -fsyntax-only -verify %s
|
|
|
|
// RUN: %clang_cc1 -x objective-c++ -fsyntax-only -verify %s
|
2012-10-19 20:44:48 +08:00
|
|
|
// expected-no-diagnostics
|
2012-01-13 06:12:08 +08:00
|
|
|
// rdar://10667659
|
|
|
|
|
|
|
|
@protocol NSCopying @end
|
|
|
|
|
|
|
|
@interface NSString <NSCopying>
|
|
|
|
@end
|
|
|
|
|
|
|
|
void takeId(id test) {}
|
|
|
|
|
|
|
|
void takeCopyableId(id<NSCopying> test) {}
|
|
|
|
|
|
|
|
id<NSCopying> Test () {
|
|
|
|
NSString const *constantString = @"Test";
|
|
|
|
takeId(constantString);
|
|
|
|
takeCopyableId(constantString);
|
|
|
|
id ID = constantString;
|
|
|
|
id<NSCopying> IDQNSCopying = constantString;
|
|
|
|
return constantString;
|
|
|
|
}
|