[PATCH] To fix an assertion crash within a member template of a non-template class in ms-compatibility & delayed template parsing

Richard Smith richard at metafoo.co.uk
Thu Apr 25 02:04:40 PDT 2013


You can use CXXRecordDecl::hasAnyDependentBases instead of writing it out
for yourself. The large example in the comment seems unnecessary; the
existing comment and unit test are enough.
On 24 Apr 2013 17:49, "Faisal Vali" <faisalv at gmail.com> wrote:

> Of course, that approach seems to work!
>
> Patch is attached - thanks!
>
>
> Faisal Vali
>
>
>
> On Wed, Apr 24, 2013 at 9:58 AM, Richard Smith <richard at metafoo.co.uk>wrote:
>
>> Hmm, OK, I see. I think we should just not be calling
>> ActOnDependentIdExpression here in the first place. That is trying to cope
>> with access to a member of 'this' in a dependent base class, and there are
>> no dependent base classes. In ActOnIdExpression, we should be looking at
>> whether the class is a dependent context (or, better, whether it has
>> dependent bases), not whether the method is.
>>
>>
>> On Wed, Apr 24, 2013 at 7:44 AM, Faisal Vali <faisalv at gmail.com> wrote:
>>
>>> But that doesn't catch the case where the qualifier is the containing
>>> class itself (A::XX) i.e which also causes an assertion violation - for
>>> e.g. this does not work:
>>>
>>>  const bool IsInMicrosoftModeWithoutAQualifierLoc =
>>>                   getSema().getLangOpts().MicrosoftMode &&
>>>                   !QualifierLoc.getNestedNameSpecifier();
>>>
>>> Any thoughts?
>>>
>>> thanks!
>>>
>>> Faisal Vali
>>>
>>>
>>>
>>> On Wed, Apr 24, 2013 at 6:57 AM, Richard Smith <richard at metafoo.co.uk>wrote:
>>>
>>>> Hi!
>>>>
>>>> E->isTypeDependent() will always be true for a
>>>> CXXDependentScopeMemberExpr, so the patch would just turn off the
>>>> optimization in MicrosoftMode. I think the right thing to check here is
>>>> that we have a QualifierLoc.
>>>>
>>>>
>>>> On Wed, Apr 24, 2013 at 4:29 AM, Faisal Vali <faisalv at gmail.com> wrote:
>>>>
>>>>> Hi Richard,
>>>>>     was working on the TemplateParameterDepth patch and while crafting
>>>>> some tests, I stumbled upon an assertion violation out of CodeGen for the
>>>>> following code compiled with -fms-compatibility and
>>>>> -fdelayed-template-parsing
>>>>>
>>>>> Once again, this might be a very narrow fix, and there might be a more
>>>>> general way to address this issue - so welcome the feedback.
>>>>>
>>>>> Thanks!
>>>>> Faisal Vali
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> 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/20130425/c621e976/attachment.html>


More information about the cfe-commits mailing list