blob: 9b48da5a33f9e84ee9c8f1e11a2b375095f383b4 [file] [log] [blame]
John McCallf85e1932011-06-15 23:02:42 +00001// RUN: %clang_cc1 -std=c++0x -fobjc-nonfragile-abi -fsyntax-only -fobjc-arc -verify -fblocks %s
2
3// "Move" semantics, trivial version.
4void move_it(__strong id &&from) {
5 id to = static_cast<__strong id&&>(from);
6}
7
8// Deduction with 'auto'.
9@interface A
10+ alloc;
11- init;
12@end
13
14// Ensure that deduction works with lifetime qualifiers.
15void deduction(id obj) {
16 auto a = [[A alloc] init];
17 __strong A** aPtr = &a;
18
19 auto a2([[A alloc] init]);
20 __strong A** aPtr2 = &a2;
21
22 __strong id *idp = new auto(obj);
23
24 __strong id array[17];
25 for (auto x : array) {
26 __strong id *xPtr = &x;
27 }
28}