[cfe-commits] [patch] Fix a crash in code gen (& an accepts invalid) for arrays of arrays of user defined types under certain circumstances

David Blaikie dblaikie at gmail.com
Sat Mar 10 16:25:22 PST 2012

On Sat, Mar 10, 2012 at 11:46 AM, John McCall <rjmccall at apple.com> wrote:
> On Mar 10, 2012, at 9:44 AM, David Blaikie wrote:
>> This fixes a hole in handling arrays of arrays of user defined types
>> that lead to the udt's ctor not being marked used (& not being
>> generated in the case of a non trivial implicit dtor in a template) &
>> not being access checked (in the case of a private dtor). The original
>> functionality doesn't seem to have ever been tested - so if there's
>> other test cases anyone thinks this functionality needs, I'd be happy
>> to add those here too.
> Looks good to me.
> -            cast<CXXRecordDecl>(AllocType->getAs<RecordType>()->getDecl()))) {
> +            cast<CXXRecordDecl>(BaseAllocType->getAs<RecordType>()->getDecl()))) {
> I know this is pre-existing, but please change the dominating isRecordType() check to use getAs and then re-use that result here.

Thanks John, committed as r152519 with the requested change & a few
extra test cases.

- David

More information about the cfe-commits mailing list