[cfe-dev] Omitted declaration
John McCall
rjmccall at apple.com
Fri Jun 11 18:58:49 PDT 2010
On Jun 9, 2010, at 12:52 AM, Abramo Bagnara wrote:
> Il 05/06/2010 18:44, Abramo Bagnara ha scritto:
>> Il 29/05/2010 18:31, Douglas Gregor ha scritto:
>>>
>>> On May 29, 2010, at 1:02 AM, Abramo Bagnara wrote:
>>>
>>>> template <typename T>
>>>> struct S {
>>>> };
>>>>
>>>> // S<int> v;
>>>>
>>>> template struct S<int>;
>>>>
>>>> Uncommenting the line above the ClassTemplateSpecializationDecl related
>>>> to the last line disappears from declarations available inside
>>>> TranslationUnitDecl.
>>>>
>>>> I don't think it's expected, right?
>>>
>>>
>>> It's expected (because it was written that way), but it's still a bug. Sema::ActOnExplicitInstantiation intentionally reuses existing ClassTemplateSpecializationDecl nodes from implicit instantiations, rather than always creating a new node. However, when we re-use such a node, we don't insert it into lexical context. It should be relatively easy to fix.
>>>
>>
>> Unfortunately not so easy... we have found this code rather mess...
>> complex ;-)
>>
>> However I've attached the patch for your review/approval.
>
> Sorry to annoy you, but we have other patches to submit and, you know,
> patches life outside current svn tree is a bit... dangerous.
This looks okay to me.
John.
More information about the cfe-dev
mailing list