[cfe-dev] Omitted declaration
Douglas Gregor
dgregor at apple.com
Sat May 29 09:31:36 PDT 2010
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.
- Doug
More information about the cfe-dev
mailing list