[PATCH] D110614: [clang-tidy] Fix false positives in cppcoreguidelines-virtual-class-destructor

2021-10-04 Thread Marco Gartmann via Phabricator via cfe-commits
mgartmann added a comment. Please excuse my late reply! I have been on vacation for the last two weeks and didn't have the time to respond to this thread until now. In D110614#3032760 , @carlosgalvezp wrote: > So the derived destructor only shows up

[PATCH] D102325: [clang-tidy] cppcoreguidelines-virtual-base-class-destructor: a new check

2021-09-03 Thread Marco Gartmann via Phabricator via cfe-commits
mgartmann added a comment. @whisperity Thanks a lot for helping me out! Name: Marco Gartmann E-Mail: gartmannma...@hotmail.com Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D102325/new/ https://reviews.llvm.org/D102325

[PATCH] D102325: [clang-tidy] cppcoreguidelines-virtual-base-class-destructor: a new check

2021-08-28 Thread Marco Gartmann via Phabricator via cfe-commits
mgartmann added a comment. @aaron.ballman Thanks a lot for your review! Can somebody help me merging this change? I do not have the rights to do so. Thanks in advanve! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D102325/new/

[PATCH] D102325: [clang-tidy] cppcoreguidelines-virtual-base-class-destructor: a new check

2021-08-09 Thread Marco Gartmann via Phabricator via cfe-commits
mgartmann updated this revision to Diff 365161. mgartmann added a comment. - Updated this patch with the current state of the LLVM project GitHub repository Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D102325/new/

[PATCH] D102325: [clang-tidy] cppcoreguidelines-virtual-base-class-destructor: a new check

2021-06-14 Thread Marco Gartmann via Phabricator via cfe-commits
mgartmann added a comment. Thanks a lot for your feedback, @aaron.ballman! I was able to incorporate it in the updated diff. On your advice, I also ran this check on a large open source project using the `run-clang-tidy.py` script. I decided to do it on the llvm project itself as follows:

[PATCH] D102325: [clang-tidy] cppcoreguidelines-virtual-base-class-destructor: a new check

2021-06-14 Thread Marco Gartmann via Phabricator via cfe-commits
mgartmann updated this revision to Diff 351869. mgartmann marked 10 inline comments as done. mgartmann added a comment. - changed name of check to `cppcoreguidelines-virtual-class-destructor` - removed matcher for class or struct in AST matcher - changed string concatenations to use `llvm::twine`

[PATCH] D102779: [clang-tidy] cppcoreguidelines-explicit-constructor-and-conversion: new alias

2021-06-14 Thread Marco Gartmann via Phabricator via cfe-commits
mgartmann added inline comments. Comment at: clang-tools-extra/clang-tidy/google/ExplicitConstructorCheck.cpp:28-30 + std::string FullOperatorName = + Node.getParent()->getNameAsString().append("::").append( + Node.getNameAsString());

[PATCH] D102779: [clang-tidy] cppcoreguidelines-explicit-constructor-and-conversion: new alias

2021-06-14 Thread Marco Gartmann via Phabricator via cfe-commits
mgartmann updated this revision to Diff 351838. mgartmann marked 5 inline comments as done. mgartmann added a comment. - removed empty configs from tests - moved documentation to Google's check - extended matchers so that namespaces for classes and conversion operators can be specified -

[PATCH] D102325: [clang-tidy] cppcoreguidelines-virtual-base-class-destructor: a new check

2021-06-01 Thread Marco Gartmann via Phabricator via cfe-commits
mgartmann updated this revision to Diff 348988. mgartmann added a comment. - added fixes for private destructors - separated fixes for private destructors into notes - added a test case for a `= default;` constructor Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D102779: [clang-tidy] cppcoreguidelines-explicit-constructor-and-conversion: new alias

2021-05-27 Thread Marco Gartmann via Phabricator via cfe-commits
mgartmann updated this revision to Diff 348178. mgartmann marked an inline comment as done. mgartmann added a comment. - added testcase of explicit operator Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D102779/new/ https://reviews.llvm.org/D102779

[PATCH] D102779: [clang-tidy] cppcoreguidelines-explicit-constructor-and-conversion: new alias

2021-05-26 Thread Marco Gartmann via Phabricator via cfe-commits
mgartmann added a comment. @aaron.ballman Thanks a lot for your valuable feedback! I incorporated it accordingly. Is there anything else that should be improved? Comment at: clang-tools-extra/clang-tidy/google/ExplicitConstructorCheck.cpp:102 if (const auto *Conversion =

[PATCH] D102779: [clang-tidy] cppcoreguidelines-explicit-constructor-and-conversion: new alias

2021-05-26 Thread Marco Gartmann via Phabricator via cfe-commits
mgartmann updated this revision to Diff 347970. mgartmann marked 5 inline comments as done. mgartmann added a comment. - added option to ignore conversion operators - added tests for new and existing options - renamed options to `Ignore...` - ensured that option's strings only get parsed once

[PATCH] D102779: [clang-tidy] cppcoreguidelines-explicit-constructor-and-conversion: new alias

2021-05-24 Thread Marco Gartmann via Phabricator via cfe-commits
mgartmann added a comment. Dear reviewers, Since this work was conducted as part of a Bachelor's thesis, which has to be handed in on the 18th of June, 2021, we wanted to add a friendly ping to this patch. It would make us, the thesis team, proud to state that some of our work was accepted and

[PATCH] D102325: [clang-tidy] cppcoreguidelines-virtual-base-class-destructor: a new check

2021-05-24 Thread Marco Gartmann via Phabricator via cfe-commits
mgartmann marked an inline comment as done. mgartmann added a comment. Dear reviewers, Since this work was conducted as part of a Bachelor's thesis, which has to be handed in on the 18th of June, 2021, we wanted to add a friendly ping to this patch. It would make us, the thesis team, proud to

[PATCH] D100972: [clang-tidy] cppcoreguidelines-avoid-non-const-global-variables: add fixes to checks

2021-05-24 Thread Marco Gartmann via Phabricator via cfe-commits
mgartmann added a comment. Dear reviewers, Since this work was conducted as part of a Bachelor's thesis, which has to be handed in on the 18th of June, 2021, we wanted to add a friendly ping to this patch. It would make us, the thesis team, proud to state that some of our work was accepted and

[PATCH] D99646: [clang-tidy] misc-avoid-std-io-outside-main: a new check

2021-05-24 Thread Marco Gartmann via Phabricator via cfe-commits
mgartmann added a comment. Dear reviewers, Since this work was conducted as part of a Bachelor's thesis, which has to be handed in on the 18th of June, 2021, we wanted to add a friendly ping to this patch. It would make us, the thesis team, proud to state that some of our work was accepted and

[PATCH] D102836: [clang] Fix Typo in AST Matcher Reference

2021-05-20 Thread Marco Gartmann via Phabricator via cfe-commits
mgartmann created this revision. mgartmann added a reviewer: klimek. mgartmann added a project: clang. mgartmann requested review of this revision. In AST Matcher Reference , the example of matcher `hasDeclContext` contained a typo.

[PATCH] D102779: [clang-tidy] cppcoreguidelines-explicit-constructor-and-conversion: new alias

2021-05-20 Thread Marco Gartmann via Phabricator via cfe-commits
mgartmann updated this revision to Diff 346640. mgartmann edited the summary of this revision. mgartmann added a comment. Added `ConstructorWhitelist` option to the `google-explicit-constructor` check. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D102779: [clang-tidy] cppcoreguidelines-explicit-constructor-and-conversion: new alias

2021-05-19 Thread Marco Gartmann via Phabricator via cfe-commits
mgartmann created this revision. Herald added subscribers: jeroen.dobbelaere, shchenz, kbarton, xazax.hun, nemanjai. mgartmann requested review of this revision. Herald added a project: clang-tools-extra. Herald added a subscriber: cfe-commits. Since the `google-explicit-constructor` check

[PATCH] D102325: [clang-tidy] cppcoreguidelines-virtual-base-class-destructor: a new check

2021-05-15 Thread Marco Gartmann via Phabricator via cfe-commits
mgartmann marked 2 inline comments as done. mgartmann added inline comments. Comment at: clang-tools-extra/docs/clang-tidy/checks/cppcoreguidelines-virtual-base-class-destructor.rst:16 + +This check implements `C.35

[PATCH] D102325: [clang-tidy] cppcoreguidelines-virtual-base-class-destructor: a new check

2021-05-15 Thread Marco Gartmann via Phabricator via cfe-commits
mgartmann updated this revision to Diff 345635. mgartmann added a comment. Resolved readability-identifier-naming warning, adjusted check's documentation. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D102325/new/ https://reviews.llvm.org/D102325

[PATCH] D99646: [clang-tidy] misc-avoid-std-io-outside-main: a new check

2021-05-15 Thread Marco Gartmann via Phabricator via cfe-commits
mgartmann updated this revision to Diff 345634. mgartmann added a comment. Fetched new commits from upstream `main` branch and resolved merge conflicts. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D99646/new/ https://reviews.llvm.org/D99646

[PATCH] D102325: [clang-tidy] cppcoreguidelines-virtual-base-class-destructor: a new check

2021-05-15 Thread Marco Gartmann via Phabricator via cfe-commits
mgartmann updated this revision to Diff 345623. mgartmann marked 2 inline comments as done. mgartmann added a comment. Incorporated Phabricator review feedback: - added matchers and tests for subclasses with inherited virtual methods - made aid methods static and not part of the check's class -

[PATCH] D102325: [clang-tidy] cppcoreguidelines-virtual-base-class-destructor: a new check

2021-05-15 Thread Marco Gartmann via Phabricator via cfe-commits
mgartmann marked 17 inline comments as done. mgartmann added a comment. In D102325#2754241 , @njames93 wrote: > Whats the intended behaviour for derived classes and their destructors? Can > test be added to demonstrate that behaviour? If a derived

[PATCH] D102325: [clang-tidy] cppcoreguidelines-virtual-base-class-destructor: a new check

2021-05-12 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: shchenz, kbarton, xazax.hun, mgorny, nemanjai. mgartmann requested review of this revision. Finds base classes and structs whose

[PATCH] D99646: [clang-tidy] misc-avoid-std-io-outside-main: a new check

2021-05-12 Thread Marco Gartmann via Phabricator via cfe-commits
mgartmann updated this revision to Diff 344731. mgartmann added a comment. Remove text from `ReleaseNotes.rst` to narrow down the cause for the failing build. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D99646/new/

[PATCH] D99646: [clang-tidy] misc-avoid-std-io-outside-main: a new check

2021-05-12 Thread Marco Gartmann via Phabricator via cfe-commits
mgartmann updated this revision to Diff 344726. mgartmann added a comment. Remove any parentheses and slashes from the check's section in `ReleaseNotes.rst` in order to try to fix the build. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D99646/new/

[PATCH] D99646: [clang-tidy] misc-avoid-std-io-outside-main: a new check

2021-05-12 Thread Marco Gartmann via Phabricator via cfe-commits
mgartmann updated this revision to Diff 344711. mgartmann added a comment. Re-add description for this check in `ReleaseNotes.rst`. Adjust `AvoidStdIoOutsideMainCheck.cpp` third matcher to call `hasAnyName()` with a vector. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D99646: [clang-tidy] misc-avoid-std-io-outside-main: a new check

2021-05-12 Thread Marco Gartmann via Phabricator via cfe-commits
mgartmann updated this revision to Diff 344692. mgartmann added a comment. Revert `ReleaseNotes.rst` to its initial content in a try to fix the pre-build tests. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D99646/new/

[PATCH] D99646: [clang-tidy] misc-avoid-std-io-outside-main: a new check

2021-05-10 Thread Marco Gartmann via Phabricator via cfe-commits
mgartmann updated this revision to Diff 344043. mgartmann added a comment. Revert `ReleaseNotes.rst` to a point where the build worked. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D99646/new/ https://reviews.llvm.org/D99646 Files:

[PATCH] D99646: [clang-tidy] misc-avoid-std-io-outside-main: a new check

2021-05-10 Thread Marco Gartmann via Phabricator via cfe-commits
mgartmann updated this revision to Diff 344030. mgartmann added a comment. Change encoding of patch to UTF-8 in order to fix build. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D99646/new/ https://reviews.llvm.org/D99646 Files:

[PATCH] D99646: [clang-tidy] misc-avoid-std-io-outside-main: a new check

2021-05-10 Thread Marco Gartmann via Phabricator via cfe-commits
mgartmann updated this revision to Diff 344023. mgartmann added a comment. Updated diff to fix the build. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D99646/new/ https://reviews.llvm.org/D99646 Files:

[PATCH] D99646: [clang-tidy] misc-avoid-std-io-outside-main: a new check

2021-05-10 Thread Marco Gartmann via Phabricator via cfe-commits
mgartmann updated this revision to Diff 344013. mgartmann added a comment. Remove trailing whitespaces from documentation file. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D99646/new/ https://reviews.llvm.org/D99646 Files:

[PATCH] D99646: [clang-tidy] misc-avoid-std-io-outside-main: a new check

2021-05-09 Thread Marco Gartmann via Phabricator via cfe-commits
mgartmann marked an inline comment as done. mgartmann added a comment. @njames93 thanks a lot for your answer! I extracted the STD IO stream and C-like function names according to your comment. In your opinion, is there something else in this patch that has to be improved to make this request

[PATCH] D99646: [clang-tidy] misc-avoid-std-io-outside-main: a new check

2021-05-09 Thread Marco Gartmann via Phabricator via cfe-commits
mgartmann updated this revision to Diff 343911. mgartmann added a comment. Extracted STD IO stream and C-like IO function names into vectors. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D99646/new/ https://reviews.llvm.org/D99646 Files:

[PATCH] D100972: [clang-tidy] cppcoreguidelines-avoid-non-const-global-variables: add fixes to checks

2021-04-30 Thread Marco Gartmann via Phabricator via cfe-commits
mgartmann added a comment. Friendly ping, any feedback would be appreciated :) Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D100972/new/ https://reviews.llvm.org/D100972 ___ cfe-commits mailing list

[PATCH] D100972: [clang-tidy] cppcoreguidelines-avoid-non-const-global-variables: add fixes to checks

2021-04-28 Thread Marco Gartmann via Phabricator via cfe-commits
mgartmann updated this revision to Diff 341155. mgartmann added a comment. Replaced string comparison to check if a character is a space with `std::isspace()`. Added test case for this scenario. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D99646: [clang-tidy] misc-avoid-std-io-outside-main: a new check

2021-04-26 Thread Marco Gartmann via Phabricator via cfe-commits
mgartmann added a comment. Friendly ping :) Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D99646/new/ https://reviews.llvm.org/D99646 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D100972: [clang-tidy] cppcoreguidelines-avoid-non-const-global-variables: add fixes to checks

2021-04-22 Thread Marco Gartmann via Phabricator via cfe-commits
mgartmann updated this revision to Diff 339574. mgartmann added a comment. Fixed one-off error. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D100972/new/ https://reviews.llvm.org/D100972 Files:

[PATCH] D100972: [clang-tidy] cppcoreguidelines-avoid-non-const-global-variables: add fixes to checks

2021-04-22 Thread Marco Gartmann via Phabricator via cfe-commits
mgartmann updated this revision to Diff 339565. mgartmann added a comment. - Renamed `printCleanedType()` to `cleanType()` - Extended `cleanType()` to also remove `(anonymous)` from a type - Made `hasSpaceAfterType()` more error-robust. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST

[PATCH] D100972: [clang-tidy] cppcoreguidelines-avoid-non-const-global-variables: add fixes to checks

2021-04-21 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: shchenz, kbarton, xazax.hun, nemanjai. mgartmann requested review of this revision. I added fixes to the existing checks of

[PATCH] D99646: [clang-tidy] misc-avoid-std-io-outside-main: a new check

2021-04-14 Thread Marco Gartmann via Phabricator via cfe-commits
mgartmann added inline comments. Comment at: clang-tools-extra/clang-tidy/misc/AvoidStdIoOutsideMainCheck.cpp:22 + Finder->addMatcher( + declRefExpr(to(varDecl(hasAnyName("cin", "wcin", "cout", "wcout", "cerr", +"wcerr"),

[PATCH] D99646: [clang-tidy] misc-avoid-std-io-outside-main: a new check

2021-04-07 Thread Marco Gartmann via Phabricator via cfe-commits
mgartmann updated this revision to Diff 335839. mgartmann added a comment. Corrected check's entry in `list.rst` after renaming the check. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D99646/new/ https://reviews.llvm.org/D99646 Files:

[PATCH] D99646: [clang-tidy] misc-avoid-std-io-outside-main: a new check

2021-04-07 Thread Marco Gartmann via Phabricator via cfe-commits
mgartmann updated this revision to Diff 335750. mgartmann retitled this revision from "[clang-tidy] misc-std-stream-objects-outside-main: a new check" to "[clang-tidy] misc-avoid-std-io-outside-main: a new check". mgartmann added a comment. - Added two new matchers to flag uses of

[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 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 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 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 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