[PATCH] D99646: [clang-tidy] misc-std-stream-objects-outside-main: a new check
Eugene Zelenko via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Mar 31 07:10:30 PDT 2021
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: clang-tools-extra/clang-tidy/misc/StdStreamObjectsOutsideMainCheck.h:24
+class StdStreamObjectsOutsideMainCheck : public ClangTidyCheck {
+public:
+ StdStreamObjectsOutsideMainCheck(StringRef Name, ClangTidyContext *Context)
----------------
Check must work only for C++. Please add `isLanguageVersionSupported`.
================
Comment at: clang-tools-extra/clang-tidy/misc/StdStreamObjectsOutsideMainCheck.h:39
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MISC_STDSTREAMOBJECTSOUTSIDEMAINCHECK_H
\ No newline at end of file
----------------
Please add newline.
================
Comment at: clang-tools-extra/docs/ReleaseNotes.rst:101
+
+ Diagnoses if a predefined standard stream object (cin, wcin,
+ cout, wcout, cerr or wcerr) is used outside the main function.
----------------
Please highlight `cin` and other with double back-ticks.
================
Comment at: clang-tools-extra/docs/clang-tidy/checks/misc-std-stream-objects-outside-main.rst:6
+
+The check diagnoses when a predefined standard stream object (i.e., ``cin``, ``wcin``,
+``cout``, ``wcout``, ``cerr`` and ``wcerr``) is used outside the ``main`` function.
----------------
Please synchronize with Release Notes and omit //The check//.
================
Comment at: clang-tools-extra/docs/clang-tidy/checks/misc-std-stream-objects-outside-main.rst:46
+mocked stream objects into ``some_function()`` during testing.
\ No newline at end of file
----------------
Please add newline.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D99646/new/
https://reviews.llvm.org/D99646
More information about the cfe-commits
mailing list