This is an archive of the discontinued LLVM Phabricator instance.

don't diagnose -Wunused-parameter in virtual method or method that overrides base class method
AbandonedPublic

Authored by danielmarjamaki on Aug 11 2015, 6:43 AM.

Details

Reviewers
krememek
Summary

Don't diagnose -Wunused-parameter in methods that override other methods because the overridden methods might use the parameter

Don't diagnose -Wunused-parameter in virtual methods because these might be overriden by other methods that use the parameter.

Such diagnostics could be more accurately written if they are based on whole-program-analysis that establish if such parameter is unused in all methods.

Diff Detail

Event Timeline

danielmarjamaki retitled this revision from to don't diagnose -Wunused-parameter in virtual method or method that overrides base class method.
danielmarjamaki updated this object.
danielmarjamaki added a reviewer: krememek.
danielmarjamaki added a subscriber: cfe-commits.
thakis added a subscriber: thakis.Aug 11 2015, 8:46 AM

Can't you just change your signature to

virtual void a(int /* x */) {}

in these cases?

danielmarjamaki abandoned this revision.Aug 11 2015, 11:24 AM

Can't you just change your signature to

virtual void a(int /* x */) {}

in these cases?

hmm.. yes I agree.

You are right, so I change my mind about this patch.

alexfh added a subscriber: alexfh.Aug 14 2015, 10:14 AM