[PATCH] D99646: [clang-tidy] misc-std-stream-objects-outside-main: a new check

2021-04-01 Thread Nathan James via Phabricator via cfe-commits
njames93 added a comment. In D99646#2663733 , @mgartmann wrote: > Hi @njames93, > I can see your point, I am going to add this functionality. > > However, I do not completely understand what you mean with //check for > function refs to these names in the

[PATCH] D99646: [clang-tidy] misc-std-stream-objects-outside-main: a new check

2021-04-01 Thread Marco Gartmann via Phabricator via cfe-commits
mgartmann added a comment. In D99646#2661651 , @njames93 wrote: > Is it not wise to also check the c standard library. > So check for function refs to these names in the global or std namespace. > `printf`, `vprintf`, `puts`, `putchar`, `scanf`, `scanf`,

[PATCH] D99646: [clang-tidy] misc-std-stream-objects-outside-main: a new check

2021-04-01 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno added inline comments. Comment at: clang-tools-extra/clang-tidy/misc/StdStreamObjectsOutsideMainCheck.cpp:25 + .bind("match"), + this); +} mgartmann wrote: > mgartmann wrote: > > riccibruno wrote: > > > Will this match

[PATCH] D99646: [clang-tidy] misc-std-stream-objects-outside-main: a new check

2021-04-01 Thread Marco Gartmann via Phabricator via cfe-commits
mgartmann added inline comments. Comment at: clang-tools-extra/clang-tidy/misc/StdStreamObjectsOutsideMainCheck.cpp:25 + .bind("match"), + this); +} mgartmann wrote: > riccibruno wrote: > > Will this match `my_namespace::cin`? > Yes, at the moment

[PATCH] D99646: [clang-tidy] misc-std-stream-objects-outside-main: a new check

2021-04-01 Thread Marco Gartmann via Phabricator via cfe-commits
mgartmann updated this revision to Diff 334632. mgartmann marked an inline comment as done. mgartmann added a comment. Add isInStdNamespace to matcher so that only global objects in namespace `std` are matched and add corresponding tests. Repository: rG LLVM Github Monorepo CHANGES SINCE

[PATCH] D99646: [clang-tidy] misc-std-stream-objects-outside-main: a new check

2021-04-01 Thread Marco Gartmann via Phabricator via cfe-commits
mgartmann updated this revision to Diff 334600. mgartmann added a comment. Removed superfluous semicolon in `StdStreamObjectsOutsideMainCheck.cpp` according to feedback. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D99646/new/

[PATCH] D99646: [clang-tidy] misc-std-stream-objects-outside-main: a new check

2021-03-31 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added inline comments. Comment at: clang-tools-extra/clang-tidy/misc/StdStreamObjectsOutsideMainCheck.h:30 +return LangOpts.CPlusPlus; + }; + Semicolon is not needed and should cause `-Wextra-semi` warnings. Repository: rG LLVM Github

[PATCH] D99646: [clang-tidy] misc-std-stream-objects-outside-main: a new check

2021-03-31 Thread Marco Gartmann via Phabricator via cfe-commits
mgartmann updated this revision to Diff 334527. mgartmann marked 4 inline comments as done. mgartmann added a comment. Refactored the code and documentation files according to the feedback received on the first diff. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D99646: [clang-tidy] misc-std-stream-objects-outside-main: a new check

2021-03-31 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added a comment. It looks like new patch was not uploaded. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D99646/new/ https://reviews.llvm.org/D99646 ___ cfe-commits mailing list

[PATCH] D99646: [clang-tidy] misc-std-stream-objects-outside-main: a new check

2021-03-31 Thread Marco Gartmann via Phabricator via cfe-commits
mgartmann marked 10 inline comments as done. mgartmann added inline comments. Comment at: clang-tools-extra/clang-tidy/misc/StdStreamObjectsOutsideMainCheck.cpp:25 + .bind("match"), + this); +} riccibruno wrote: > Will this match

[PATCH] D99646: [clang-tidy] misc-std-stream-objects-outside-main: a new check

2021-03-31 Thread Nathan James via Phabricator via cfe-commits
njames93 added a comment. Is it not wise to also check the c standard library. So check for function refs to these names in the global or std namespace. `printf`, `vprintf`, `puts`, `putchar`, `scanf`, `scanf`, `getchar` and `gets` It may be a bit of a pain checking for usages of `stdin` and

[PATCH] D99646: [clang-tidy] misc-std-stream-objects-outside-main: a new check

2021-03-31 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added inline comments. Comment at: clang-tools-extra/clang-tidy/misc/StdStreamObjectsOutsideMainCheck.cpp:61 +} // namespace clang \ No newline at end of file Please add newline. Comment at:

[PATCH] D99646: [clang-tidy] misc-std-stream-objects-outside-main: a new check

2021-03-31 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno added inline comments. Comment at: clang-tools-extra/clang-tidy/misc/StdStreamObjectsOutsideMainCheck.cpp:25 + .bind("match"), + this); +} Will this match `my_namespace::cin`? Comment at:

[PATCH] D99646: [clang-tidy] misc-std-stream-objects-outside-main: a new check

2021-03-31 Thread Marco Gartmann via Phabricator via cfe-commits
mgartmann added a comment. I am working on fixing the failing build. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D99646/new/ https://reviews.llvm.org/D99646 ___ cfe-commits mailing list

[PATCH] D99646: [clang-tidy] misc-std-stream-objects-outside-main: a new check

2021-03-31 Thread Marco Gartmann via Phabricator via cfe-commits
mgartmann created this revision. mgartmann added reviewers: aaron.ballman, njames93, alexfh. mgartmann added a project: clang-tools-extra. Herald added subscribers: xazax.hun, mgorny. mgartmann requested review of this revision. **Problem Description** The `iostream` header file defines multiple