This is an archive of the discontinued LLVM Phabricator instance.

Add -Wduplicate-protocol for existing diagnostic
ClosedPublic

Authored by kastiglione on Nov 8 2016, 10:30 AM.

Details

Summary

Expose a warning flag for warn_duplicate_protocol_def. This allows control
over the severity of duplicate protocol definitions.

For example -Werror=duplicate-protocol or
#pragma clang diagnostic ignored "-Wduplicate-protocol".

Diff Detail

Repository
rL LLVM

Event Timeline

kastiglione retitled this revision from to Add -Wduplicate-protocol for existing diagnostic.
kastiglione updated this object.
kastiglione added a reviewer: cfe-commits.
kastiglione edited reviewers, added: compnerd, modocache; removed: cfe-commits.Nov 8 2016, 10:32 AM
kastiglione added a subscriber: cfe-commits.

I'm not sure that it's required, but shouldn't we have also have a test that checks for the usage of this flag as well? Adding a test case with #pragma clang diagnostic ignored "-Wduplicate-protocol" and some code to a file like "test/SemaObjC/check-dup-objc-decls-1.m" should be sufficient.

@arphaman I wondered whether this called for a test. I'm happy to add one just like that.

arphaman accepted this revision.Nov 9 2016, 2:11 AM
arphaman added a reviewer: arphaman.

LGTM

This revision is now accepted and ready to land.Nov 9 2016, 2:11 AM

Thanks @arphaman, are you able to commit this?

Thanks @arphaman, are you able to commit this?

Yes, I can commit this for you. Let me know what commit message I should use.

kastiglione added a comment.EditedNov 10 2016, 10:00 AM

@arphaman Thank you. Is the summary here sufficient, or should I elaborate in some way? I'm fine with this summary if you are.

It seems sufficient enough, I will commit it with the summary. Thanks!

This revision was automatically updated to reflect the committed changes.