This is an archive of the discontinued LLVM Phabricator instance.

[clang][Sema] Fix caret position to be on the non null parameter
ClosedPublic

Authored by Grillo on Oct 20 2022, 7:12 AM.

Details

Summary

When checking for non null arguments the wrong SourceLocation was given,
this fix to pass the proper argument's location.

Reported in PR58273.

Diff Detail

Event Timeline

Grillo created this revision.Oct 20 2022, 7:12 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 20 2022, 7:12 AM
Grillo requested review of this revision.Oct 20 2022, 7:12 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 20 2022, 7:12 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript

Thank you for the fix!

Can you add test coverage to show the behavioral change? You can either position the problematic null argument on its own line (so you can validate the correct position) or use -fdiagnostics-print-source-range-info to check a specific range. Also, can you add a release note about the fix to clang/docs/ReleaseNotes.rst?

Grillo updated this revision to Diff 469559.Oct 21 2022, 5:34 AM

Add test coverage and release note about the fix to clang/docs/ReleaseNotes.rst

Grillo updated this revision to Diff 469571.Oct 21 2022, 6:20 AM
Grillo updated this revision to Diff 469604.Oct 21 2022, 7:25 AM
Grillo updated this revision to Diff 469605.
aaron.ballman accepted this revision.Oct 21 2022, 10:47 AM

LGTM aside from a tiny grammar nit. Thank you for the fix! If you'd like me to commit this on your behalf, I can fix up the release note myself when landing, but please let me know what name and email address you'd like me to use for patch attribution.

clang/docs/ReleaseNotes.rst
328
This revision is now accepted and ready to land.Oct 21 2022, 10:47 AM
Grillo added a comment.EditedOct 22 2022, 6:53 AM

LGTM aside from a tiny grammar nit. Thank you for the fix! If you'd like me to commit this on your behalf, I can fix up the release note myself when landing, but please let me know what name and email address you'd like me to use for patch attribution.

If you could that would be great! My name and email is Arthur Grillo <arthur.grillo@usp.br>.

Best Regards,
Arthur Grillo

This revision was automatically updated to reflect the committed changes.