File tree Expand file tree Collapse file tree 3 files changed +15
-1
lines changed Expand file tree Collapse file tree 3 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -272,7 +272,7 @@ Declaration::Declaration(const Declaration& rhs)
272
272
, isDependent(rhs.isDependent)
273
273
, isImplicit(rhs.isImplicit)
274
274
, isInvalid(rhs.isInvalid)
275
- , isDeprecated(false )
275
+ , isDeprecated(rhs.isDeprecated )
276
276
, completeDeclaration(rhs.completeDeclaration)
277
277
, definitionOrder(rhs.definitionOrder)
278
278
, PreprocessedEntities(rhs.PreprocessedEntities)
Original file line number Diff line number Diff line change @@ -144,6 +144,13 @@ public bool DoAllModulesHaveLibraries() =>
144
144
/// </summary>
145
145
public bool GenerateDefaultValuesForArguments { get ; set ; }
146
146
147
+ /// <summary>
148
+ /// If set to false, then deprecated C/C++ declarations (those that have
149
+ /// the `__attribute__((deprecated))` or equivalent attribute) will not be
150
+ /// generated.
151
+ /// </summary>
152
+ public bool GenerateDeprecatedDeclarations { get ; set ; } = true ;
153
+
147
154
public bool StripLibPrefix { get ; set ; }
148
155
149
156
/// <summary>
Original file line number Diff line number Diff line change @@ -85,6 +85,13 @@ public override bool VisitDeclaration(Declaration decl)
85
85
return true ;
86
86
}
87
87
88
+ if ( decl . IsDeprecated && ! Options . GenerateDeprecatedDeclarations )
89
+ {
90
+ Diagnostics . Debug ( "Decl '{0}' was ignored due to being deprecated" , decl . Name ) ;
91
+ decl . ExplicitlyIgnore ( ) ;
92
+ return true ;
93
+ }
94
+
88
95
if ( ! CheckDeclarationAccess ( decl ) )
89
96
{
90
97
Diagnostics . Debug ( "Decl '{0}' was ignored due to invalid access" ,
You can’t perform that action at this time.
0 commit comments