[PATCH] D63089: [clang] Warn on implicit boolean casts in more contexts (PR34180)

2019-06-10 Thread Mateusz Maćkowski via Phabricator via cfe-commits
m4tx created this revision. m4tx added reviewers: lebedev.ri, rsmith, klimek. Herald added a project: clang. Herald added a subscriber: cfe-commits. int x; return x = 5; For a code like above, GCC produces a warning suggesting using parentheses about the assignment. This change makes clang p

[PATCH] D61256: [clang-format][docs] Fix the Google C++ and Chromium style guide URLs

2019-06-10 Thread Mateusz Maćkowski via Phabricator via cfe-commits
m4tx added a comment. @MyDeveloperDay thanks for accepting the revision! Since I do not have commit access, could you please make the commit for me? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D61256/new/ https://reviews.llvm.org/D61256 __

[PATCH] D55793: [clang-tidy] Add duplicated access specifier readability check (PR25403)

2019-06-10 Thread Mateusz Maćkowski via Phabricator via cfe-commits
m4tx added a comment. @JonasToth thanks for asking! Yes, since I do not have commit access, I need someone to do the commit for me. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D55793/new/ https://reviews.llvm.org/D55793 ___ cfe-commits ma

[PATCH] D61256: [clang-format][docs] Fix the Google C++ and Chromium style guide URLs

2019-04-29 Thread Mateusz Maćkowski via Phabricator via cfe-commits
m4tx created this revision. m4tx added reviewers: djasper, MyDeveloperDay. Herald added a project: clang. Herald added a subscriber: cfe-commits. The Google C++ and Chromium style guides are broken in the clang-format docs. This patch updates them. Repository: rG LLVM Github Monorepo https:/

[PATCH] D55793: [clang-tidy] Add duplicated access specifier readability check (PR25403)

2019-04-28 Thread Mateusz Maćkowski via Phabricator via cfe-commits
m4tx updated this revision to Diff 197028. m4tx marked 5 inline comments as done. m4tx added a comment. Remove the accidentally added patch file CHANGES SINCE LAST ACTION https://reviews.llvm.org/D55793/new/ https://reviews.llvm.org/D55793 Files: clang-tools-extra/clang-tidy/readability/CM

[PATCH] D55793: [clang-tidy] Add duplicated access specifier readability check (PR25403)

2019-04-28 Thread Mateusz Maćkowski via Phabricator via cfe-commits
m4tx marked 15 inline comments as done. m4tx added inline comments. Comment at: clang-tools-extra/clang-tidy/readability/RedundantAccessSpecifiersCheck.cpp:35-36 + for (DeclContext::specific_decl_iterator + AS(MatchedDecl->decls_begin()), + ASEnd(MatchedDecl->de

[PATCH] D55793: [clang-tidy] Add duplicated access specifier readability check (PR25403)

2019-04-28 Thread Mateusz Maćkowski via Phabricator via cfe-commits
m4tx updated this revision to Diff 197025. m4tx added a comment. Updated per @aaron.ballman comments CHANGES SINCE LAST ACTION https://reviews.llvm.org/D55793/new/ https://reviews.llvm.org/D55793 Files: 0001-clang-tidy-Add-duplicated-access-specifier-readabili.patch clang-tools-extra/cla

[PATCH] D55793: [clang-tidy] Add duplicated access specifier readability check (PR25403)

2019-04-16 Thread Mateusz Maćkowski via Phabricator via cfe-commits
m4tx updated this revision to Diff 195409. m4tx added a comment. Updated the backticks in the documentation. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D55793/new/ https://reviews.llvm.org/D55793 Files: clang-tools-extra/clang-tidy/readability

[PATCH] D55793: [clang-tidy] Add duplicated access specifier readability check (PR25403)

2019-04-16 Thread Mateusz Maćkowski via Phabricator via cfe-commits
m4tx updated this revision to Diff 195408. m4tx added a comment. Herald added a project: clang. Updated the diff for the latest (master) version, used GitHub monorepo for the changes Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D55793/new/ https:/

[PATCH] D55793: [clang-tidy] Add duplicated access specifier readability check (PR25403)

2019-01-13 Thread Mateusz Maćkowski via Phabricator via cfe-commits
m4tx added a comment. I've added the implicit access specifier check and run it on some bigger codebases. My findings are as below: - Dolphin: 6 //triggers across// 856 //record types// - OpenCV: 31 //triggers across// 3370 //record types// - Inkscape: 39 //triggers across// 846 //record types//

[PATCH] D55793: [clang-tidy] Add duplicated access specifier readability check (PR25403)

2019-01-13 Thread Mateusz Maćkowski via Phabricator via cfe-commits
m4tx updated this revision to Diff 181474. m4tx marked an inline comment as not done. Repository: rCTE Clang Tools Extra CHANGES SINCE LAST ACTION https://reviews.llvm.org/D55793/new/ https://reviews.llvm.org/D55793 Files: clang-tidy/readability/CMakeLists.txt clang-tidy/readability/Rea

[PATCH] D55793: [clang-tidy] Add duplicated access specifier readability check (PR25403)

2018-12-20 Thread Mateusz Maćkowski via Phabricator via cfe-commits
m4tx updated this revision to Diff 179138. m4tx marked an inline comment as done. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D55793/new/ https://reviews.llvm.org/D55793 Files: clang-tidy/readability/CMakeLists.txt clang-tidy/readability/DuplicatedAccessSpecifiersCheck.cpp clang-t

[PATCH] D55793: [clang-tidy] Add duplicated access specifier readability check (PR25403)

2018-12-20 Thread Mateusz Maćkowski via Phabricator via cfe-commits
m4tx marked 4 inline comments as done. m4tx added a comment. In D55793#1335274 , @lebedev.ri wrote: > In D55793#1335249 , @m4tx wrote: > > > In D55793#1333661 , @lebedev.ri

[PATCH] D55793: [clang-tidy] Add duplicated access specifier readability check (PR25403)

2018-12-18 Thread Mateusz Maćkowski via Phabricator via cfe-commits
m4tx added a comment. In D55793#1333661 , @lebedev.ri wrote: > Please add tests with preprocessor (`#if ...`) that will show that it ignores > disabled code. e.g.: > > class ProbablyValid { > private: > int a; > #if defined(ZZ) > public: >

[PATCH] D55793: [clang-tidy] Add duplicated access specifier readability check (PR25403)

2018-12-18 Thread Mateusz Maćkowski via Phabricator via cfe-commits
m4tx marked an inline comment as done. m4tx added a comment. In D55793#1333723 , @riccibruno wrote: > In D55793#1333691 , @m4tx wrote: > > > Don't use `CXXRecordDecl::accessSpecs()`, use unique comments in tests. >

[PATCH] D55793: [clang-tidy] Add duplicated access specifier readability check (PR25403)

2018-12-18 Thread Mateusz Maćkowski via Phabricator via cfe-commits
m4tx marked 6 inline comments as done. m4tx added inline comments. Comment at: clang-tidy/readability/DuplicatedAccessSpecifiersCheck.cpp:33 + for (DeclContext::specific_decl_iterator + NS(MatchedDecl->decls_begin()), + NSEnd(MatchedDecl->decls_end()); --

[PATCH] D55793: [clang-tidy] Add duplicated access specifier readability check (PR25403)

2018-12-18 Thread Mateusz Maćkowski via Phabricator via cfe-commits
m4tx updated this revision to Diff 178777. m4tx added a comment. Fix variable names, add macro expansion checking as well as macro and inner class tests. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D55793/new/ https://reviews.llvm.org/D55793 Files: clang-tidy/readability/CMakeLists

[PATCH] D55793: [clang-tidy] Add duplicated access specifier readability check (PR25403)

2018-12-17 Thread Mateusz Maćkowski via Phabricator via cfe-commits
m4tx updated this revision to Diff 178543. m4tx added a comment. Don't use `CXXRecordDecl::accessSpecs()`, use unique comments in tests. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D55793/new/ https://reviews.llvm.org/D55793 Files: clang-tidy/readability/CMakeLists.txt clang-tidy/

[PATCH] D55790: [AST] Add accessSpecs() iterator range for CXXRecordDecl

2018-12-17 Thread Mateusz Maćkowski via Phabricator via cfe-commits
m4tx added a comment. In D55790#1333627 , @riccibruno wrote: > Do you really have to add an iterator for this particular thing ? > Why not just use `specific_decl_iterator` in your clang-tidy > checker ? I don't need to - if this is the preferred way t

[PATCH] D55793: [clang-tidy] Add duplicated access specifier readability check (PR25403)

2018-12-17 Thread Mateusz Maćkowski via Phabricator via cfe-commits
m4tx updated this revision to Diff 178539. m4tx added a comment. Use alphabetical order in ReleaseNotes.rst CHANGES SINCE LAST ACTION https://reviews.llvm.org/D55793/new/ https://reviews.llvm.org/D55793 Files: clang-tidy/readability/CMakeLists.txt clang-tidy/readability/DuplicatedAccessS

[PATCH] D55793: [clang-tidy] Add duplicated access specifier readability check

2018-12-17 Thread Mateusz Maćkowski via Phabricator via cfe-commits
m4tx created this revision. Herald added subscribers: cfe-commits, xazax.hun, mgorny. This finds redundant access specifier declarations inside classes, structs, and unions. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D55793 Files: clang-tidy/readability/CMakeLists.txt c

[PATCH] D55790: [AST] Add accessSpecs() iterator range for CXXRecordDecl

2018-12-17 Thread Mateusz Maćkowski via Phabricator via cfe-commits
m4tx created this revision. Herald added a subscriber: cfe-commits. Adds an iterator that allows to loop over C++ class/union/struct access specifier declarations. Repository: rC Clang https://reviews.llvm.org/D55790 Files: include/clang/AST/DeclCXX.h Index: include/clang/AST/DeclCXX.h

[PATCH] D54262: [clang-tidy] Add `delete this` bugprone check (PR38741)

2018-11-19 Thread Mateusz Maćkowski via Phabricator via cfe-commits
m4tx added a comment. After thinking about the possible use cases (and the difficulty of implementing heuristics for them) as well as fiddling with Clang Static Analyzer it seems that this patch can be discarded as the Analyzer already handles `delete this` pretty well. I've posted an update to

[PATCH] D54262: [clang-tidy] Add `delete this` bugprone check (PR38741)

2018-11-08 Thread Mateusz Maćkowski via Phabricator via cfe-commits
m4tx created this revision. m4tx added reviewers: alexfh, hokein. Herald added subscribers: cfe-commits, xazax.hun, mgorny. Add a bugprone check to clang-tidy that detects the usages of `delete this`. The warning is shown even when `delete this` is the last line in the method (as there is no gua