Repository navigation
Check Template Uses
This algorithm traverses a source model and checks that each use of a module template definition refers to a valid template definition. It also constructs the use-def map entries for template expansion specifiers.
-
A list tul of translation units.
-
An analysis data structure a representing the results of analysis so far.
-
Translation unit lists: Visit each translation unit tu in tul in order.
-
Translation units: Visit a translation unit tu by visiting its members tum.
-
Translation unit members: Visit a translation unit member tum as follows:
-
Module definitions: If tum is a module definition d with name n, then
-
Look up the module symbol sym associated with the unqualified name n in the nested scope of a, in the value name group.
-
Look up the mapping from sym to s in the symbol-scope map of a. If no such mapping exists, then throw an internal error.
-
Push s onto the nested scope of a.
-
Visit each translation unit member of d.
-
Pop s off the nested scope of a.
-
-
Module template expansion: If tum is a template expansion specifier te, then
-
Visit the template name t used in te using the same rules as for uses, resolving t in the template name group. This adds a mapping from the use to its definition in the use-def map of a.
-
-
Otherwise do nothing.
-