[PATCH] D59402: Fix-it hints for -Wmissing-{prototypes,variable-declarations}

2019-03-16 Thread Aaron Puchert via Phabricator via cfe-commits
aaronpuchert updated this revision to Diff 190966. aaronpuchert added a comment. Don't suggest adding `static` if there is a non-prototype declaration. This required a minor refactoring: we let `ShouldWarnAboutMissingPrototype` return any kind of declaration it finds and check for the number of

[PATCH] D59402: Fix-it hints for -Wmissing-{prototypes,variable-declarations}

2019-03-14 Thread Aaron Puchert via Phabricator via cfe-commits
aaronpuchert added inline comments. Comment at: test/Sema/warn-missing-prototypes.c:7 int f(int x) { return x; } // expected-warning{{no previous prototype for function 'f'}} +// CHECK: fix-it:"{{.*}}":{[[@LINE-1]]:1-[[@LINE-1]]:1}:"static " Maybe there

[PATCH] D59402: Fix-it hints for -Wmissing-{prototypes,variable-declarations}

2019-03-14 Thread Aaron Puchert via Phabricator via cfe-commits
aaronpuchert created this revision. aaronpuchert added reviewers: bkramer, efriedma, rsmith. Herald added subscribers: cfe-commits, jdoerfert. Herald added a project: clang. I've found that most often the proper way to fix this warning is to add `static`, because if the code otherwise compiles