Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] Clone CDT project

> Could you please explain what do you mean by "take an extra IASTNode
> parameter that represents the point of instantiation."? What's the point of
> instantiation?

An ICPPClassSpecialization represents an instance of a class template (or a class nested inside an instance of a class template). An instance of a class template is created when something in the code requires it - for example it, when you declare a variable of type C<int> where C is your class template.

The point in the program that causes the instantiation of the class template is called the point of instantiation. In CDT we represent this as an IASTNode whose location is the point of instantiation.

Many operations on templates require the point of instantiation as an input, because it plays a role in C++'s name lookup rules (during the second phase of two-phase name lookup inside a template, entities declared before the point of instantiation are visible to argument-dependent lookup, even if the entity's point of declaration is after the template's definition).

If you give some more details about what type of analysis you are performing, I may be able to make a suggestion about what to use as the point of instantiation.

Regards,
Nate

Back to the top