This is an archive of the discontinued LLVM Phabricator instance.

[Clang] [Sema] Removed a fix-it for system headers
ClosedPublic

Authored by fahadnayyar on Jan 16 2023, 11:46 AM.

Details

Summary

Disabled an invalid fix-it which suggested fixes to be applied in system headers for some programs in IDEs like Xcode.

rdar://100890960

Diff Detail

Event Timeline

fahadnayyar created this revision.Jan 16 2023, 11:46 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 16 2023, 11:46 AM
Herald added a subscriber: arphaman. · View Herald Transcript
fahadnayyar requested review of this revision.Jan 16 2023, 11:46 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 16 2023, 11:46 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
NoQ added a comment.Jan 17 2023, 5:03 PM

Looks great! Sounds like you're looking for a more permanent fix, I guess ConversionFixItGenerator could try to avoid adding fixits to system header functions?

clang/lib/Sema/SemaOverload.cpp
10923–10927

Since you're reformatting anyway, maybe use a range-based for-loop?

NoQ added inline comments.Jan 18 2023, 1:43 PM
clang/lib/Sema/SemaOverload.cpp
10923–10927

(or for_each)

You should also add a release note for the changes.

clang/lib/Sema/SemaOverload.cpp
10920–10926

Let's drop the rdar link as that's not helpful for anyone outside of Apple.

Added release notes and changed a normal for-loop to range-based for-loop.

fahadnayyar marked 3 inline comments as done.Jan 19 2023, 11:45 AM

Looks great! Sounds like you're looking for a more permanent fix, I guess ConversionFixItGenerator could try to avoid adding fixits to system header functions?

It probably requires some larger rearchitecturing of the FixItGeneration implementation to avoid system headers for all kinds of FixitHints like ConversionFixIt. We can do that later as a separate patch after getting some more examples where fixits are suggested for system headers.

You should also add a release note for the changes.

Done!

aaron.ballman accepted this revision.Jan 19 2023, 11:58 AM

LGTM!

clang/docs/ReleaseNotes.rst
362
This revision is now accepted and ready to land.Jan 19 2023, 11:58 AM
This revision was landed with ongoing or failed builds.Jan 20 2023, 1:29 PM
This revision was automatically updated to reflect the committed changes.