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)
272272 , isDependent(rhs.isDependent)
273273 , isImplicit(rhs.isImplicit)
274274 , isInvalid(rhs.isInvalid)
275- , isDeprecated(false )
275+ , isDeprecated(rhs.isDeprecated )
276276 , completeDeclaration(rhs.completeDeclaration)
277277 , definitionOrder(rhs.definitionOrder)
278278 , PreprocessedEntities(rhs.PreprocessedEntities)
Original file line number Diff line number Diff line change @@ -144,6 +144,13 @@ public bool DoAllModulesHaveLibraries() =>
144144 /// </summary>
145145 public bool GenerateDefaultValuesForArguments { get ; set ; }
146146
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+
147154 public bool StripLibPrefix { get ; set ; }
148155
149156 /// <summary>
Original file line number Diff line number Diff line change @@ -85,6 +85,13 @@ public override bool VisitDeclaration(Declaration decl)
8585 return true ;
8686 }
8787
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+
8895 if ( ! CheckDeclarationAccess ( decl ) )
8996 {
9097 Diagnostics . Debug ( "Decl '{0}' was ignored due to invalid access" ,
You can’t perform that action at this time.
0 commit comments