@@ -35,23 +35,23 @@ struct TParam;
35
35
36
36
struct TypeTParam
37
37
{
38
- // default type for the type template parameter
38
+ /* * Default type for the type template parameter */
39
39
std::optional<TypeInfo> Default;
40
40
};
41
41
42
42
struct NonTypeTParam
43
43
{
44
- // type of the non-type template parameter
44
+ /* * Type of the non-type template parameter */
45
45
TypeInfo Type;
46
- // non -type template parameter default value (if any)
46
+ // Non -type template parameter default value (if any)
47
47
std::optional<std::string> Default;
48
48
};
49
49
50
50
struct TemplateTParam
51
51
{
52
- // template parameters for the template template parameter
52
+ /* * Template parameters for the template template parameter */
53
53
std::vector<TParam> Params;
54
- // non -type template parameter default value (if any)
54
+ /* * Non -type template parameter default value (if any) */
55
55
std::optional<std::string> Default;
56
56
};
57
57
@@ -96,11 +96,11 @@ struct TParam
96
96
}
97
97
98
98
public:
99
- // The kind of template parameter this is.
99
+ /* * The kind of template parameter this is. */
100
100
TParamKind Kind = TParamKind::None;
101
- // The template parameters name, if any
101
+ /* * The template parameters name, if any */
102
102
std::string Name;
103
- // Whether this template parameter is a parameter pack.
103
+ /* * Whether this template parameter is a parameter pack. */
104
104
bool IsParameterPack = false ;
105
105
106
106
@@ -191,31 +191,34 @@ struct TArg
191
191
192
192
// ----------------------------------------------------------------
193
193
194
- // stores information pertaining to an explicit specialization of a
195
- // member of an implicitly instantiated class template specialization.
196
- // this structure is stored in the TemplateInfo corresponding to the
197
- // outermost specialized template. if the explicitly specialized
198
- // member is itself a member of a nested template, the SpecializationInfo
199
- // which stores the arguments for the parent template will additionally
200
- // store a pointer to the SpecializationInfo for the nested template,
201
- // recursively. each SpecializationInfo node contains a vector of
202
- // SymbolIDs pairs `(specialized, primary)`, where `specialized` is the
203
- // replacement definition of `primary` for the given set of template
204
- // arguments of its parent template(s).
194
+ /* * Stores information pertaining to an explicit specialization of a
195
+ member of an implicitly instantiated class template specialization.
196
+
197
+ This structure is stored in the `TemplateInfo` corresponding to the
198
+ outermost specialized template. If the explicitly specialized
199
+ member is itself a member of a nested template, the `SpecializationInfo`
200
+ which stores the arguments for the parent template will additionally
201
+ store a pointer to the SpecializationInfo for the nested template,
202
+ recursively. Each `SpecializationInfo` node contains a vector of
203
+ `SymbolID` pairs `(specialized, primary)`, where `specialized` is the
204
+ replacement definition of `primary` for the given set of template
205
+ arguments of its parent template(s).
206
+ */
205
207
struct SpecializationInfo
206
208
{
207
- // template arguments a parent template is specialized for
209
+ /* * The template arguments the parent template is specialized for */
208
210
std::vector<TArg> Args;
209
211
210
- // ID of the template to which the arguments pertain
212
+ /* * ID of the template to which the arguments pertain */
211
213
SymbolID Template;
212
214
213
- // SpecializationInfo for nested templates which are also specialized
215
+ /* * SpecializationInfo for nested templates which are also specialized */
214
216
std::vector<SpecializationInfo> Nested;
215
217
216
- // SymbolID pairs of any specialized members.
217
- // the first element is the ID of the original member (i.e. member that is replaced)
218
- // the second element is the ID of the specialized member (i.e. replacement)
218
+ /* * SymbolID pairs of any specialized members.
219
+ the first element is the ID of the original member (i.e. member that is replaced)
220
+ the second element is the ID of the specialized member (i.e. the replacement)
221
+ */
219
222
std::vector<std::pair<SymbolID, SymbolID>> Members;
220
223
};
221
224
@@ -228,28 +231,32 @@ enum class TemplateSpecKind
228
231
Partial
229
232
};
230
233
231
- // stores information pertaining to primary template and
232
- // partial/explicit specialization declarations
234
+ /* * Stores information pertaining to primary template and
235
+ partial/explicit specialization declarations
236
+ */
233
237
struct TemplateInfo
234
238
{
235
- // for primary templates:
236
- // - Params will be non-empty
237
- // - Args will be empty
238
- // for explicit specializations:
239
- // - Params will be empty
240
- // for partial specializations:
241
- // - Params will be non-empty
242
- // - each template parameter will appear at least
243
- // once in Args outside of a non-deduced context
239
+ /* * For primary templates:
240
+ - Params will be non-empty
241
+ - Args will be empty
242
+ For explicit specializations:
243
+ - Params will be empty
244
+ For partial specializations:
245
+ - Params will be non-empty
246
+ - each template parameter will appear at least
247
+ once in Args outside of a non-deduced context
248
+ */
244
249
std::vector<TParam> Params;
245
250
std::vector<TArg> Args;
246
251
247
- // stores the ID of the corresponding primary template
248
- // for partial and explicit specializations
252
+ /* * Stores the ID of the corresponding primary template
253
+ for partial and explicit specializations
254
+ */
249
255
OptionalSymbolID Primary;
250
256
251
- // stores information for explicit specializations of members
252
- // of implicitly instantiated class template specializations
257
+ /* * Stores information for explicit specializations of members
258
+ of implicitly instantiated class template specializations
259
+ */
253
260
std::vector<SpecializationInfo> Specializations;
254
261
255
262
// KRYSTIAN NOTE: using the presence of args/params
0 commit comments