[cfe-dev] Omitted declaration
Abramo Bagnara
abramo.bagnara at gmail.com
Sat Jun 5 09:44:23 PDT 2010
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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ClassTemplate-ExplicitInst-3.patch
Type: text/x-patch
Size: 15886 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20100605/ba4504c4/attachment.bin>
More information about the cfe-dev
mailing list