blob: 996664f6a9e09482ead033f6ac95c0c525835077 [file] [log] [blame]
Fariborz Jahanianf2b4f7b2012-01-12 22:12:08 +00001// RUN: %clang_cc1 -fsyntax-only -verify %s
2// RUN: %clang_cc1 -x objective-c++ -fsyntax-only -verify %s
Andy Gibbs8e8fb3b2012-10-19 12:44:48 +00003// expected-no-diagnostics
Fariborz Jahanianf2b4f7b2012-01-12 22:12:08 +00004// rdar://10667659
5
6@protocol NSCopying @end
7
8@interface NSString <NSCopying>
9@end
10
11void takeId(id test) {}
12
13void takeCopyableId(id<NSCopying> test) {}
14
15id<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}