[4.0] [SE-0160] [PrintAsObjC] Adopt Clang's new diagnose_if attribute. #9898
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Explanation: When available, use Clang's new
diagnose_ifattribute to markObjective-C methods/properties that were generated based on the
@objcinference rules that have been removed from Swift 4. The
diagnose_ifwarnings aren't likely to be accidentally disabled or hidden by other
deprecated code.
Scope: Affects the Objective-C generated header, used in mixed Swift/ObjC projects, in a backward-compatible way.
Radar: rdar://problem/32370734
Risk: In theory, I could have made an error that makes the generated header unparseable with some combination of Clang build settings, although that seems unlikely.
Testing: Compiler regression testing; verified separately that the generated header, when used in ObjC code, produces the expected warnings that are not sensitive to
-Wno-deprecated-decls.