[PATCH] D81444: Make the diagnostic-missing-prototypes put the suggested `static` in front of `const` if exists.

2020-06-09 Thread Vy Nguyen via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGa21a46205165: Make the diagnostic-missing-prototypes put the suggested `static` in front of… (authored by oontvoo). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D81444: Make the diagnostic-missing-prototypes put the suggested `static` in front of `const` if exists.

2020-06-09 Thread Vy Nguyen via Phabricator via cfe-commits
oontvoo updated this revision to Diff 269657. oontvoo marked an inline comment as done. oontvoo added a comment. Address review comment Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D81444/new/ https://reviews.llvm.org/D81444 Files:

[PATCH] D81444: Make the diagnostic-missing-prototypes put the suggested `static` in front of `const` if exists.

2020-06-09 Thread Vy Nguyen via Phabricator via cfe-commits
oontvoo marked 7 inline comments as done. oontvoo added inline comments. Comment at: clang/test/Sema/warn-missing-prototypes.c:62 + +const struct MyStruct get_struct() { // expected-warning{{no previous prototype for function 'get_struct'}} +

[PATCH] D81444: Make the diagnostic-missing-prototypes put the suggested `static` in front of `const` if exists.

2020-06-09 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr2 added inline comments. Comment at: clang/lib/Lex/Lexer.cpp:1302 +bool Lexer::isConst(SourceLocation Loc, const SourceManager , +const LangOptions ) { I'm concerned about putting this API into Lexer, given this implementation. It

[PATCH] D81444: Make the diagnostic-missing-prototypes put the suggested `static` in front of `const` if exists.

2020-06-09 Thread Vy Nguyen via Phabricator via cfe-commits
oontvoo updated this revision to Diff 269627. oontvoo marked an inline comment as done. oontvoo added a comment. - Less brittle way to find the loc of const. - Add more tests Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D81444/new/

[PATCH] D81444: Make the diagnostic-missing-prototypes put the suggested `static` in front of `const` if exists.

2020-06-09 Thread Vy Nguyen via Phabricator via cfe-commits
oontvoo marked an inline comment as done. oontvoo added inline comments. Comment at: clang/lib/Sema/SemaDecl.cpp:14252 + FD->getReturnType().isConstQualified()) +return FD->getReturnTypeSourceRange().getBegin().getLocWithOffset( +

[PATCH] D81444: Make the diagnostic-missing-prototypes put the suggested `static` in front of `const` if exists.

2020-06-09 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr2 added inline comments. Comment at: clang/lib/Sema/SemaDecl.cpp:14252 + FD->getReturnType().isConstQualified()) +return FD->getReturnTypeSourceRange().getBegin().getLocWithOffset( +/*strlen("const ")=*/-6);

[PATCH] D81444: Make the diagnostic-missing-prototypes put the suggested `static` in front of `const` if exists.

2020-06-08 Thread Vy Nguyen via Phabricator via cfe-commits
oontvoo created this revision. oontvoo added a reviewer: gribozavr2. Herald added a project: clang. Herald added a subscriber: cfe-commits. Consider: `const int* get_foo() {return nullptr;}` The suggested fix should be `static const int* get_foo(){}` and not `const static int* get_foo(){}`