1 // RUN: %clang_cc1 -verify -fsyntax-only -Wno-objc-root-class %s
7 + (void)setMagicNumber:(int)value;
8 + (void)setFakeSetterNumber:(int)value;
11 @implementation Subclass
17 + (void)setMagicNumber:(int)value {
21 + (void)setFakeSetterNumber:(int)value {
27 self.magicNumber = 10;
28 if (self.magicNumber != 10)
36 Subclass.magicNumber = 2 /*[Subclass setMagicNumber:2]*/;
37 if (Subclass.magicNumber != 0)
39 if (Subclass.magicNumber != 2)
41 Subclass.magicNumber += 3;
42 if (Subclass.magicNumber != 5)
44 Subclass.magicNumber -= 5;
45 if (Subclass.magicNumber != 0)
47 /* We only have a setter in the following case. */
48 Subclass.fakeSetterNumber = 123;
50 /* We read it using the other getter. */
51 if (Subclass.magicNumber != 123)
53 Subclass.fakeSetterNumber = Subclass.magicNumber;
54 if (Subclass.magicNumber != 123)
57 Subclass.fakeSetterNumberX = 123; // expected-error{{property 'fakeSetterNumberX' not found on object of type 'Subclass'}}
59 /* Test class methods using the new syntax. */