This is an archive of the discontinued LLVM Phabricator instance.

[Sema] Make __attribute__((notnull)) inheritable through function parameters
ClosedPublic

Authored by bettinson on Nov 17 2016, 7:18 AM.

Details

Summary

Fix PR 30828. __attribute__((notnull)) was not inheritable in the redefinition of a function. This is because attribute NonNull wasn't InheritableParamAttr, it was InheritableAttr. Clang will now emit warning after calling the redeclared function with a null argument.

This is my first patch into Clang, so I'll need someone to commit this for me.

Cheers

Diff Detail

Event Timeline

bettinson updated this revision to Diff 78365.Nov 17 2016, 7:18 AM
bettinson retitled this revision from to [Sema] Make __attribute__((notnull)) inheritable through function parameters.
bettinson updated this object.
bettinson added reviewers: rsmith, aaron.ballman.
bettinson added a subscriber: cfe-commits.
ahatanak added inline comments.
test/Sema/nonnull.c
171

Is this not pr30828?

aaron.ballman edited edge metadata.Dec 16 2016, 7:18 AM

Modulo the comment from @ahatanak, I think this looks good. Once you have addressed that comment, I can commit for you.

bettinson updated this revision to Diff 91204.Mar 9 2017, 11:51 AM

Updated the test name. Sorry for the delay!

aaron.ballman accepted this revision.Mar 12 2017, 3:42 PM
This revision is now accepted and ready to land.Mar 12 2017, 3:42 PM
aaron.ballman closed this revision.Mar 12 2017, 3:42 PM

Committed in r297592, thank you!