break;
case Sema::NC_Type:
- // We have a type.
// We have a type. In C, this means that we have a declaration.
if (!getLang().CPlusPlus) {
ParsedType Type = Classification.getType();
// unqualified lookup mechanism.
if (!SS.isSet() && CurMethod && !isResultTypeOrTemplate(Result, NextToken)) {
ExprResult E = LookupInObjCMethod(Result, S, Name, true);
-
- if (E.isInvalid())
- return NameClassification::Error();
-
- if (E.get())
+ if (E.get() || E.isInvalid())
return E;
// Synthesize ivars lazily.
// FIXME: This is strange. Shouldn't we just take the ivar returned
// from SynthesizeProvisionalIvar and continue with that?
- E = LookupInObjCMethod(Result, S, Name, true);
-
- if (E.isInvalid())
- return NameClassification::Error();
-
- if (E.get())
+ E = LookupInObjCMethod(Result, S, Name, true);
+ if (E.get() || E.isInvalid())
return E;
}
}
}
@end
+@interface TwoIvars {
+ int a;
+ int b;
+}
+@end
+
+@implementation TwoIvars
++ (int)classMethod {
+ return a + b; // expected-error{{instance variable 'a' accessed in class method}} \
+ // expected-error{{instance variable 'b' accessed in class method}}
+}
+@end