r178548 - [ms-cxxabi] Move MS inheritance model calculation into MemberPointerType

Reid Kleckner rnk at google.com
Wed Apr 3 17:42:01 PDT 2013


Maybe the record decl is dependent?  We should be hitting
RequireCompleteType() in SemaType, and I would expect it to be complete at
this point.

I have a few template tests, but I don't think I was creative enough with
C++ to catch this.  Can you make a minimal repro with deltamin or something?

As a workaround, we could return MSIM_Unspecified for incomplete types that
come here, but this is likely to have other edge case bugs because the size
could shrink if the decl ever becomes complete and then we generate some
member pointer code.


On Wed, Apr 3, 2013 at 6:44 PM, João Matos <ripzonetriton at gmail.com> wrote:

> On Tue, Apr 2, 2013 at 5:23 PM, Reid Kleckner <reid at kleckner.net> wrote:
>
> +MSInheritanceModel CXXRecordDecl::getMSInheritanceModel() const {
>> +  Attr *IA = this->getAttr<MSInheritanceAttr>();
>> +  if (IA)
>> +    return MSInheritanceAttrToModel(IA->getKind());
>> +  // If there was no explicit attribute, the record must be defined
>> already, and
>> +  // we can figure out the inheritance model from its other properties.
>> +  if (this->getNumVBases() > 0)
>> +    return IHM_Virtual;
>
>
> I am getting an assert here. Specifically, getNumVBases() asserts in
> data() because the record has no definition data. According to the comment
> it should be defined when reaching that line.
>
> Any guesses why this is happening?
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130403/2e93cb86/attachment.html>


More information about the cfe-commits mailing list