On Dec 3, 2013, at 13:11, Argyrios Kyrtzidis <[email protected]> wrote:

> +void ObjCInterfaceDecl::getDesignatedInitializers(
> +    llvm::SmallVectorImpl<const ObjCMethodDecl *> &Methods) const {
> +  assert(hasDefinition());
> +  if (data().ExternallyCompleted)
> +    LoadExternalDefinition();
> +
> +  const ObjCInterfaceDecl *IFace = this;
> +  while (IFace) {
> +    if (IFace->data().HasDesignatedInitializers)
> +      break;
> +    IFace = IFace->getSuperClass();
> +  }
> +
> +  if (!IFace)
> +    return;
> +  for (instmeth_iterator I = IFace->instmeth_begin(),
> +                         E = IFace->instmeth_end(); I != E; ++I) {
> +    const ObjCMethodDecl *MD = *I;
> +    if (MD->getMethodFamily() == OMF_init &&
> +        MD->hasAttr<ObjCDesignatedInitializerAttr>())
> +      Methods.push_back(MD);
> +  }
> +}

Is this correct? This says that even if I declare new init methods (and don't 
mark any as designated), the designated initializers are still my superclass's 
designated initializers. I think this is a backwards-compatibility problem for 
people shipping subclasses with new init methods.

Jordan

_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to