This is an archive of the discontinued LLVM Phabricator instance.

Fix misc-unused-parameters handling of function templates
ClosedPublic

Authored by swallace on Jul 22 2015, 7:36 AM.

Details

Reviewers
chandlerc
djasper
Summary

The parameters of the function templates were being marked as incorrectly be marked as unused.
Added a test for this and changed the check to use the same isReferenced() || !getDeclName() logic as Sema::DiagnoseUnusedParameters.

Diff Detail

Event Timeline

swallace updated this revision to Diff 30352.Jul 22 2015, 7:36 AM
swallace retitled this revision from to Fix misc-unused-parameters handling of function templates.
swallace updated this object.
swallace added reviewers: djasper, chandlerc.
swallace added a subscriber: cfe-commits.
djasper edited edge metadata.Jul 22 2015, 7:45 AM

Cool. Looks good. Wanna extend the test to ensure that we mark unused parameters of function templates? Do you have commit access?

I'll try and add a few more test cases.

I don't have commit access.

swallace updated this revision to Diff 30362.Jul 22 2015, 9:42 AM
swallace edited edge metadata.

Add a couple of cases showing that unused parameters in function templates do correctly get removed.

djasper accepted this revision.Jul 22 2015, 10:31 AM
djasper edited edge metadata.

Cool. Thank you. Submitted as r242912.

This revision is now accepted and ready to land.Jul 22 2015, 10:31 AM
djasper closed this revision.Jul 22 2015, 10:31 AM