File tree 12 files changed +459
-469
lines changed
12 files changed +459
-469
lines changed Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ struct ConceptInfo
28
28
{
29
29
/* * The concepts template parameters
30
30
*/
31
- std::unique_ptr <TemplateInfo> Template;
31
+ std::optional <TemplateInfo> Template;
32
32
33
33
/* * The concepts constraint-expression
34
34
*/
Original file line number Diff line number Diff line change @@ -126,13 +126,16 @@ struct FunctionInfo
126
126
: InfoCommonBase<InfoKind::Function>
127
127
, SourceInfo
128
128
{
129
- std::unique_ptr<TypeInfo> ReturnType; // Info about the return type of this function.
130
- std::vector<Param> Params; // List of parameters.
129
+ / / / Info about the return type of this function.
130
+ std::unique_ptr<TypeInfo> ReturnType;
131
131
132
- // When present, this function is a template or specialization .
133
- std::unique_ptr<TemplateInfo> Template ;
132
+ // / List of parameters .
133
+ std::vector<Param> Params ;
134
134
135
- // the class of function this is
135
+ // / When present, this function is a template or specialization.
136
+ std::optional<TemplateInfo> Template;
137
+
138
+ // / The class of function this is
136
139
FunctionClass Class = FunctionClass::Normal;
137
140
138
141
NoexceptInfo Noexcept;
Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ struct GuideInfo
38
38
39
39
/* * Template head, if any.
40
40
*/
41
- std::unique_ptr <TemplateInfo> Template;
41
+ std::optional <TemplateInfo> Template;
42
42
43
43
/* * The parameters of the deduction guide.
44
44
*/
Original file line number Diff line number Diff line change @@ -85,11 +85,11 @@ struct RecordInfo
85
85
*/
86
86
RecordKeyKind KeyKind = RecordKeyKind::Struct;
87
87
88
- // When present, this record is a template or specialization.
89
- std::unique_ptr <TemplateInfo> Template;
88
+ // / When present, this record is a template or specialization.
89
+ std::optional <TemplateInfo> Template;
90
90
91
- // Indicates if the record was declared using a typedef. Things like anonymous
92
- // structs in a typedef:
91
+ // Indicates if the record was declared using a typedef.
92
+ // Things like anonymous structs in a typedef:
93
93
// typedef struct { ... } foo_t;
94
94
// are converted into records with the typedef as the Name + this flag set.
95
95
// KRYSTIAN FIXME: this does not account for alias-declarations
Original file line number Diff line number Diff line change @@ -369,9 +369,14 @@ struct TemplateInfo
369
369
TemplateSpecKind specializationKind () const noexcept
370
370
{
371
371
if (Params.empty ())
372
+ {
372
373
return TemplateSpecKind::Explicit;
373
- return Args.empty () ? TemplateSpecKind::Primary :
374
- TemplateSpecKind::Partial;
374
+ }
375
+ if (Args.empty ())
376
+ {
377
+ return TemplateSpecKind::Primary;
378
+ }
379
+ return TemplateSpecKind::Partial;
375
380
}
376
381
};
377
382
388
393
tag_invoke (
389
394
dom::ValueFromTag,
390
395
dom::Value& v,
391
- std::unique_ptr <TemplateInfo> const & I,
396
+ std::optional <TemplateInfo> const & I,
392
397
DomCorpus const * domCorpus)
393
398
{
394
399
if (!I)
Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ struct TypedefInfo
35
35
// typedef std::vector<int> MyVector;
36
36
bool IsUsing = false ;
37
37
38
- std::unique_ptr <TemplateInfo> Template;
38
+ std::optional <TemplateInfo> Template;
39
39
40
40
// --------------------------------------------
41
41
Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ struct VariableInfo
34
34
/* * The type of the variable */
35
35
std::unique_ptr<TypeInfo> Type;
36
36
37
- std::unique_ptr <TemplateInfo> Template;
37
+ std::optional <TemplateInfo> Template;
38
38
39
39
ExprInfo Initializer;
40
40
You can’t perform that action at this time.
0 commit comments