[cfe-commits] Fix for crash with specialization?
Douglas Gregor
dgregor at apple.com
Wed Sep 16 14:00:36 PDT 2009
On Sep 16, 2009, at 1:51 PM, Eli Friedman wrote:
> On Wed, Sep 16, 2009 at 7:40 AM, Douglas Gregor <dgregor at apple.com>
> wrote:
>>
>> On Sep 15, 2009, at 5:12 PM, Eli Friedman wrote:
>>
>>> On Tue, Sep 15, 2009 at 5:05 PM, Douglas Gregor
>>> <dgregor at apple.com> wrote:
>>>>
>>>> On Sep 15, 2009, at 5:01 PM, Eli Friedman wrote:
>>>>
>>>>> Attached prevents the following from crashing:
>>>>> template<typename _CharT> struct A {int x();};
>>>>> template<> int A<char>::x() { return 1; }
>>>>>
>>>>> Does the patch look close to correct, or is the issue more
>>>>> fundamental?
>>>>
>>>>
>>>> We should only call RequireCompleteDeclContext if
>>>> !DC->isDependentContext();
>>>> otherwise, the patch looks good.
>>>>
>>>> - Doug
>>>
>>> Okay; where do you suggest I put the test?
>>
>> Just:
>>
>> + if (!DC->isDependentContext() &&
>> RequireCompleteDeclContext(D.getCXXScopeSpec()))
>> + return DeclPtrTy();
>>
>> - Doug
>
> Oops, sorry, I meant "where should I put the testcase"?
Well, I guess it can go in test/SemaCXX/template-specialization.cpp,
which may stop crashing with your fix.
- Doug
More information about the cfe-commits
mailing list