Awesome, that was fast!

On Jul 25, 2012, at 5:27 PM, Anna Zaks <[email protected]> wrote:

> +      // This is a calss method.
> +      // If we have type info for the receiver class, we are calling via
> +      // class name.

Typo: "calss".

> +      if (ObjCInterfaceDecl *IDecl = E->getReceiverInterface()) {
> +        return LookupClassMethodDefinition(E->getSelector(), IDecl);
> +      }

No braces needed, method name could be lowercase (although I did see you're 
intending to refactor it).

> +// False negative.
> +// ObjC class method call through a decl with a known type.
> +// We should be able to track the type of currentClass and inline this call.
> +@interface MyClassKT : NSObject
> +@end
> +@interface MyClassKT (MyCatKT)
> ++ (int)getInt;
> +@end
> +@implementation MyClassKT (MyCatKT)
> ++ (int)getInt {
> +    return 0;
> +}
> +@end
> +@implementation MyClassKT
> +- (int)testClassMethodByKnownVarDecl {
> +  Class currentClass = [self class];
> +  int y = [currentClass getInt];
> +  return 5/y; // Would be great to get a warning here.
> +}
> +@end

[self class] could be a subclass, so this isn't /exactly/ a false negative.
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to