[PATCH] D52686: [clang-tidy] use CHECK-NOTES in test for cppgoreguidelines-avoid-goto

2018-09-29 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth created this revision. JonasToth added reviewers: alexfh, aaron.ballman, hokein. Herald added subscribers: cfe-commits, kbarton, xazax.hun, nemanjai. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D52686 Files: test/clang-tidy/cppcoreguidelines-avoid-goto.cpp Index:

[PATCH] D52687: [clang-tidy] NFC use CHECK-NOTES in tests for cppcoreguidelines-owning-memory

2018-09-29 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth created this revision. JonasToth added reviewers: alexfh, aaron.ballman, hokein. Herald added subscribers: cfe-commits, kbarton, xazax.hun, nemanjai. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D52687 Files: test/clang-tidy/cppcoreguidelines-owning-memory-containers

[PATCH] D52688: [clang-tidy] NFC use CHECK-NOTES in tests for fuchsia-default-arguments

2018-09-29 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth created this revision. JonasToth added reviewers: alexfh, aaron.ballman, hokein. Herald added subscribers: cfe-commits, xazax.hun. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D52688 Files: test/clang-tidy/fuchsia-default-arguments.cpp Index: test/clang-tidy/fuchsi

[PATCH] D52690: [clang-tidy] NFC use CHECK-NOTES in tests for misc-misplaced-const

2018-09-29 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth created this revision. JonasToth added reviewers: alexfh, aaron.ballman, hokein. Herald added subscribers: cfe-commits, xazax.hun. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D52690 Files: test/clang-tidy/misc-misplaced-const.c test/clang-tidy/misc-misplaced-const

[PATCH] D52691: [clang-tidy] NFC use CHECK-NOTES in tests for performance-move-constructor-init

2018-09-29 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth created this revision. JonasToth added reviewers: alexfh, aaron.ballman, hokein. Herald added subscribers: cfe-commits, xazax.hun. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D52691 Files: test/clang-tidy/performance-move-constructor-init.cpp Index: test/clang-tid

[PATCH] D52670: [clang-tidy] Add new 'readability-uppercase-literal-suffix' check (CERT DCL16-C, MISRA C:2012, 7.3, MISRA C++:2008, 2-13-4)

2018-09-29 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. > All those are UserDefinedLiteral, so we should be good.. > https://godbolt.org/z/PcGi0B > Also, it seems the suffix can't be set for these constants: > https://godbolt.org/z/YHTqke > So i'm not sure what to test. Can you give an example of a test? I am not suggest

[PATCH] D52670: [clang-tidy] Add new 'readability-uppercase-literal-suffix' check (CERT DCL16-C, MISRA C:2012, 7.3, MISRA C++:2008, 2-13-4)

2018-09-30 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added inline comments. Comment at: clang-tidy/readability/UppercaseLiteralSuffixCheck.cpp:165 + + diag(LiteralLocation, "%0 literal suffix '%1' is not upper-case") + << LiteralType::Name << S.OldSuffix lebedev.ri wrote: > lebedev.ri wrote: > > Jon

[PATCH] D51949: [clang-tidy] new check 'readability-isolate-declaration'

2018-10-01 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 167696. JonasToth added a comment. - remove spurious change in fixithintutils Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D51949 Files: clang-tidy/readability/CMakeLists.txt clang-tidy/readability/IsolateDeclarationCheck.cpp clang

[PATCH] D52691: [clang-tidy] NFC use CHECK-NOTES in tests for performance-move-constructor-init

2018-10-01 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added inline comments. Comment at: test/clang-tidy/performance-move-constructor-init.cpp:115-117 + // CHECK-NOTES: 7:1: note: FIX-IT applied suggested code changes + // CHECK-NOTES: 113:28: note: FIX-IT applied suggested code changes + // CHECK-NOTES: 113:29: note: F

[PATCH] D52690: [clang-tidy] NFC use CHECK-NOTES in tests for misc-misplaced-const

2018-10-01 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added inline comments. Comment at: test/clang-tidy/misc-misplaced-const.c:18 + // CHECK-NOTES: :[[@LINE-1]]:12: warning: 'i3' declared with a const-qualified typedef type; results in the type being 'int *const' instead of 'const int *' + // CHECK-NOTES: :[[@LINE-14]

[PATCH] D52684: [clang-tidy] NFC refactor lexer-utils slightly to be easier to use

2018-10-01 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. This patch is related to https://reviews.llvm.org/D51949 To isolate variable declarations (split `int * p, v;` up) it is necessary to do a lot of work with source location and requires some forward and backwards lexing. The functions there just use the LangOpts and th

[PATCH] D52687: [clang-tidy] NFC use CHECK-NOTES in tests for cppcoreguidelines-owning-memory

2018-10-02 Thread Jonas Toth via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL343564: [clang-tidy] NFC use CHECK-NOTES in tests for cppcoreguidelines-owning-memory (authored by JonasToth, committed by ). Herald added a subscriber: llvm-commits. Repository: rL LLVM https://review

[PATCH] D52686: [clang-tidy] NFC use CHECK-NOTES in test for cppgoreguidelines-avoid-goto

2018-10-02 Thread Jonas Toth via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL343565: [clang-tidy] NFC use CHECK-NOTES in test for cppgoreguidelines-avoid-goto (authored by JonasToth, committed by ). Herald added a subscriber: llvm-commits. Repository: rL LLVM https://reviews.ll

[PATCH] D52727: [clang-tidy] White List Option for performance-unnecessary-value-param, performance-unnecessary-copy-initialization and performance-for-range-copy

2018-10-02 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added inline comments. Comment at: clang-tidy/performance/ForRangeCopyCheck.cpp:49 + // Skip whitelisted types + const auto VarType = Var->getType(); + if (std::find_if(WhiteListTypes.begin(), WhiteListTypes.end(), lebedev.ri wrote: > I'm not sure wh

[PATCH] D52691: [clang-tidy] NFC use CHECK-NOTES in tests for performance-move-constructor-init

2018-10-02 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 167917. JonasToth added a comment. - adjust regex in check_clang_tidy Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D52691 Files: test/clang-tidy/check_clang_tidy.py test/clang-tidy/performance-move-constructor-init.cpp Index: test/

[PATCH] D52691: [clang-tidy] NFC use CHECK-NOTES in tests for performance-move-constructor-init

2018-10-02 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth marked 2 inline comments as done. JonasToth added a comment. check_clang_tidy now ignores `note: FIX-IT`, so only diagnostics directly emitted from the check are tested Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D52691 ___

[PATCH] D52691: [clang-tidy] NFC use CHECK-NOTES in tests for performance-move-constructor-init

2018-10-02 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 167918. JonasToth added a comment. - fix spurious change Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D52691 Files: test/clang-tidy/check_clang_tidy.py test/clang-tidy/performance-move-constructor-init.cpp Index: test/clang-tidy/pe

[PATCH] D52690: [clang-tidy] NFC use CHECK-NOTES in tests for misc-misplaced-const

2018-10-02 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 167919. JonasToth added a comment. - use absolute line number for note Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D52690 Files: test/clang-tidy/misc-misplaced-const.c test/clang-tidy/misc-misplaced-const.cpp Index: test/clang-tid

[PATCH] D52691: [clang-tidy] NFC use CHECK-NOTES in tests for performance-move-constructor-init

2018-10-02 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 167933. JonasToth added a comment. -note remove spurious reordering Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D52691 Files: test/clang-tidy/check_clang_tidy.py test/clang-tidy/performance-move-constructor-init.cpp Index: test/

[PATCH] D52691: [clang-tidy] NFC use CHECK-NOTES in tests for performance-move-constructor-init

2018-10-02 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 167932. JonasToth added a comment. - filter with builtin python before passing to FileCheck Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D52691 Files: test/clang-tidy/check_clang_tidy.py test/clang-tidy/performance-move-constructor-i

[PATCH] D52691: [clang-tidy] NFC use CHECK-NOTES in tests for performance-move-constructor-init

2018-10-02 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added inline comments. Comment at: test/clang-tidy/check_clang_tidy.py:172 '-check-prefix=' + check_notes_prefix, - '-implicit-check-not={{note|warning|error}}:'], + '-implicit-check-not=warning|error}}:|note: (?!FIX-IT)}}'],

[PATCH] D52691: [clang-tidy] NFC use CHECK-NOTES in tests for performance-move-constructor-init

2018-10-02 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 167934. JonasToth marked 2 inline comments as done. JonasToth added a comment. - finally remove spurious change Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D52691 Files: test/clang-tidy/check_clang_tidy.py test/clang-tidy/performanc

[PATCH] D52781: [clangd] Don't make check-clangd as a dependency in check-clang-tools

2018-10-02 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. Verified that it does not block other clang-extra tools if clangd tests fail. Thank you very much for fixing! Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D52781 ___ cfe-commits mailing list cfe-commits@

[PATCH] D52727: [clang-tidy] White List Option for performance-unnecessary-value-param, performance-unnecessary-copy-initialization and performance-for-range-copy

2018-10-02 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added inline comments. Comment at: clang-tidy/performance/ForRangeCopyCheck.cpp:50 + const auto VarType = Var->getType(); + if (std::find_if(WhiteListTypes.begin(), WhiteListTypes.end(), + [&](llvm::StringRef WhiteListType) { balogha

[PATCH] D52782: [clang-tidy] Sequence statements with multiple parents correctly (PR39149)

2018-10-02 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added inline comments. Comment at: clang-tidy/utils/ExprSequence.cpp:103 for (const Stmt *Parent : getParentStmts(S, Context)) { +// For statements that have multiple parents, make sure we're using the +// parent that lies within the sub-tree under Root.

[PATCH] D52727: [clang-tidy] White List Option for performance-unnecessary-value-param, performance-unnecessary-copy-initialization and performance-for-range-copy

2018-10-02 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. True Am 02.10.2018 um 22:28 schrieb Roman Lebedev via Phabricator: > lebedev.ri added inline comments. > > > Comment at: clang-tidy/performance/ForRangeCopyCheck.cpp:50 > + const auto VarType = Var->getType(); > + if (std::find_if(WhiteListTypes.

[PATCH] D52771: [clang-tidy] Non-private member variables in classes (MISRA, CppCoreGuidelines, HICPP)

2018-10-03 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added inline comments. Comment at: clang-tidy/misc/NonPrivateMemberVariablesInClassesCheck.cpp:26 + +AST_MATCHER(clang::CXXRecordDecl, hasNonStaticMethod) { + return hasMethod(unless(isStaticStorageClass())) I think this and the next matcher can be a n

[PATCH] D51949: [clang-tidy] new check 'readability-isolate-declaration'

2018-10-03 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 168091. JonasToth marked 2 inline comments as done. JonasToth added a comment. - remove spurious local variable Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D51949 Files: clang-tidy/readability/CMakeLists.txt clang-tidy/readability/I

[PATCH] D52688: [clang-tidy] NFC use CHECK-NOTES in tests for fuchsia-default-arguments

2018-10-03 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 168092. JonasToth added a comment. - remove FIX-IT as these will be filtered with the other patch Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D52688 Files: test/clang-tidy/fuchsia-default-arguments.cpp Index: test/clang-tidy/fuchsia

[PATCH] D41648: [clang-tidy] implement cppcoreguidelines macro rules

2018-10-03 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 168094. JonasToth added a comment. - Merge branch 'master' into check_macros_usage Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D41648 Files: clang-tidy/cppcoreguidelines/CMakeLists.txt clang-tidy/cppcoreguidelines/CppCoreGuidelinesT

[PATCH] D41648: [clang-tidy] implement cppcoreguidelines macro rules

2018-10-03 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. @aaron.ballman What do you think of the current version of this check? As migration strategy the option for `CAPS_ONLY` is provided, otherwise the filtering is provided to silence necessary macros (which kind of enforces a common prefix for macros). This does implement

[PATCH] D41648: [clang-tidy] implement cppcoreguidelines macro rules

2018-10-03 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 168095. JonasToth added a comment. - add more positive tests - Merge branch 'master' into check_macros_usage Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D41648 Files: clang-tidy/cppcoreguidelines/CMakeLists.txt clang-tidy/cppcoregui

[PATCH] D52782: [clang-tidy] Sequence statements with multiple parents correctly (PR39149)

2018-10-04 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. Thanks for clarification :) Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D52782 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D52880: [clang-tidy] fix PR39167, bugprone-exception-escape hangs-up

2018-10-04 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth created this revision. JonasToth added reviewers: alexfh, aaron.ballman, baloghadamsoftware. Herald added subscribers: cfe-commits, rnkovacs, xazax.hun. The check bugprone-exception-escape should not register if -fno-exceptions is set for the compile options. Bailing out on non-cplusplu

[PATCH] D52782: [clang-tidy] Sequence statements with multiple parents correctly (PR39149)

2018-10-04 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. In https://reviews.llvm.org/D52782#1254945, @mboehme wrote: > In https://reviews.llvm.org/D52782#1254933, @JonasToth wrote: > > > Thanks for clarification :) > > > Thanks! Do you agree this is ready to land now? Sure! Repository: rCTE Clang Tools Extra https://re

[PATCH] D52880: [clang-tidy] fix PR39167, bugprone-exception-escape hangs-up

2018-10-04 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. This should definitly be backported, as exception-escape is in 7.0 and it hangs up on no-except builds Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D52880 ___ cfe-commits mailing list cfe-commits@lists.l

[PATCH] D52880: [clang-tidy] fix PR39167, bugprone-exception-escape hangs-up

2018-10-04 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. In https://reviews.llvm.org/D52880#1255031, @lebedev.ri wrote: > Needs a test. How shall i test it? It feels that this condition should have been there from the beginning on, as the check only makes sense in c++ and with exceptions. Repository: rCTE Clang Tools E

[PATCH] D52727: [clang-tidy] White List Option for performance-unnecessary-value-param, performance-unnecessary-copy-initialization and performance-for-range-copy

2018-10-04 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added inline comments. Comment at: clang-tidy/utils/Matchers.cpp:18-19 + +Matcher +matchesAnyListedName(const std::vector &NameList) { + SmallString<256> NameRegEx; lebedev.ri wrote: > baloghadamsoftware wrote: > > lebedev.ri wrote: > > > Actually wait

[PATCH] D52880: [clang-tidy] fix PR39167, bugprone-exception-escape hangs-up

2018-10-04 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. In https://reviews.llvm.org/D52880#1255250, @alexfh wrote: > In https://reviews.llvm.org/D52880#1255249, @alexfh wrote: > > > Have you figured out why exactly does the check hang? Disabling it for > > -fno-exceptions may just hide a logical problem in the check. > > >

[PATCH] D52882: [clang-tidy] Added pointer types to clang-tidy readability-identifier-naming check.

2018-10-04 Thread Jonas Toth via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rCTE343788: [clang-tidy] Added pointer types to clang-tidy readability-identifier-naming… (authored by JonasToth, committed by ). Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D52882 Files

[PATCH] D52882: [clang-tidy] Added pointer types to clang-tidy readability-identifier-naming check.

2018-10-04 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. Committed on your behalf Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D52882 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D52880: [clang-tidy] fix PR39167, bugprone-exception-escape hangs-up

2018-10-04 Thread Jonas Toth via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL343789: [clang-tidy] fix PR39167, bugprone-exception-escape hangs-up (authored by JonasToth, committed by ). Herald added a subscriber: llvm-commits. Repository: rL LLVM https://reviews.llvm.org/D52880

[PATCH] D52880: [clang-tidy] fix PR39167, bugprone-exception-escape hangs-up

2018-10-04 Thread Jonas Toth via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rCTE343789: [clang-tidy] fix PR39167, bugprone-exception-escape hangs-up (authored by JonasToth, committed by ). Changed prior to commit: https://reviews.llvm.org/D52880?vs=168262&id=168301#toc Repositor

[PATCH] D51332: [clang-tidy] Replace deprecated std::ios_base aliases

2018-10-04 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. from my side is nothing outstanding https://reviews.llvm.org/D51332 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D52691: [clang-tidy] NFC use CHECK-NOTES in tests for performance-move-constructor-init

2018-10-04 Thread Jonas Toth via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rCTE343791: [clang-tidy] NFC use CHECK-NOTES in tests for performance-move-constructor-init (authored by JonasToth, committed by ). Changed prior to commit: https://reviews.llvm.org/D52691?vs=167934&id=16

[PATCH] D52691: [clang-tidy] NFC use CHECK-NOTES in tests for performance-move-constructor-init

2018-10-04 Thread Jonas Toth via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL343791: [clang-tidy] NFC use CHECK-NOTES in tests for performance-move-constructor-init (authored by JonasToth, committed by ). Herald added a subscriber: llvm-commits. Repository: rL LLVM https://revi

[PATCH] D52688: [clang-tidy] NFC use CHECK-NOTES in tests for fuchsia-default-arguments

2018-10-04 Thread Jonas Toth via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rCTE343792: [clang-tidy] NFC use CHECK-NOTES in tests for fuchsia-default-arguments (authored by JonasToth, committed by ). Changed prior to commit: https://reviews.llvm.org/D52688?vs=168092&id=168310#toc

[PATCH] D52892: [Clang-tidy: readability] readability check to convert numerical constants to std::numeric_limits

2018-10-04 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. Hi IdrissRio, thanks for working on this! I have one question: Why are variables _not_ considered in the check but only constants? IMHO it would make sense to transform these as well. I dont have time for long review today anymore, I will continue tomorrow. =

[PATCH] D52880: [clang-tidy] fix PR39167, bugprone-exception-escape hangs-up

2018-10-05 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. This patch does not fix the underlying issue. I do have a candidate that might cause it, but I am not sure if it is functionally preserving (tests seems to work though!). I think it is best if @baloghadamsoftware takes a look at it as well! Repository: rL LLVM ht

[PATCH] D52892: [Clang-tidy] readability check to convert numerical constants to std::numeric_limits

2018-10-05 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. @aaron.ballman I have a question for an expert: How would bitfields relate to this check? Can there be a similar pattern for them and do they need to be handled here? Comment at: clang-tidy/readability/NumericalCostantsToMaxIntCheck.cpp:62 +Comp

[PATCH] D51332: [clang-tidy] Replace deprecated std::ios_base aliases

2018-10-05 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth closed this revision. JonasToth added a comment. Commited in https://reviews.llvm.org/rL343848. Thank you for the patch! https://reviews.llvm.org/D51332 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/

[PATCH] D52771: [clang-tidy] Non-private member variables in classes (MISRA, CppCoreGuidelines, HICPP)

2018-10-05 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added inline comments. Comment at: clang-tidy/misc/NonPrivateMemberVariablesInClassesCheck.cpp:26 + +AST_MATCHER(clang::CXXRecordDecl, hasNonStaticMethod) { + return hasMethod(unless(isStaticStorageClass())) lebedev.ri wrote: > JonasToth wrote: > > I t

[PATCH] D52771: [clang-tidy] Non-private member variables in classes (MISRA, CppCoreGuidelines, HICPP)

2018-10-05 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. In https://reviews.llvm.org/D52771#1256432, @aaron.ballman wrote: > I can't help but notice how badly C.133 and C.9 interact with C.131 and I'm > worried we will wind up with clang-tidy checks that leave the user in an > impossible situation where they need to make da

[PATCH] D52690: [clang-tidy] NFC use CHECK-NOTES in tests for misc-misplaced-const

2018-10-05 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added inline comments. Comment at: test/clang-tidy/misc-misplaced-const.c:18 + // CHECK-NOTES: :[[@LINE-1]]:12: warning: 'i3' declared with a const-qualified typedef type; results in the type being 'int *const' instead of 'const int *' + // CHECK-NOTES: :[[@LINE-14]

[PATCH] D52684: [clang-tidy] NFC refactor lexer-utils to be usable without ASTContext

2018-10-05 Thread Jonas Toth via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL343850: [clang-tidy] NFC refactor lexer-utils to be usable without ASTContext (authored by JonasToth, committed by ). Herald added a subscriber: llvm-commits. Repository: rL LLVM https://reviews.llvm.o

[PATCH] D52771: [clang-tidy] Non-private member variables in classes (MISRA, CppCoreGuidelines, HICPP)

2018-10-05 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. C.131 seems to imply a minimal amount of trivial getters/setters before diagnosing. I feel that the CPPCG just want to force the programmer to think twice instead of forbidding it totally. It might be worth to have a more chatty/specific check for the CPPCG and a strict

[PATCH] D52527: [clang-format] fix Bug 38686: add AfterCaseLabel to BraceWrapping

2018-10-06 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. In https://reviews.llvm.org/D52527#1257277, @owenpan wrote: > I'd greatly appreciate it if someone could review this before I commit it > next week. Please do not commit without review. It is ok, to write `ping` every 5-7 days if there is no comment from the reviewe

[PATCH] D52219: [analyzer] (1/n) Support pointee mutation analysis in ExprMutationAnalyzer.

2018-10-07 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. I think you can commit, there was enough opportunity to respond and we pinged directly as well. Repository: rC Clang https://reviews.llvm.org/D52219 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.

[PATCH] D51949: [clang-tidy] new check 'readability-isolate-declaration'

2018-10-07 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth marked 2 inline comments as done. JonasToth added a comment. @kbobyrev is it ok for you if I stick with the `Optional<>` style in the check? Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D51949 ___ cfe-commits mailing list

[PATCH] D51949: [clang-tidy] new check 'readability-isolate-declaration'

2018-10-07 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 168598. JonasToth added a comment. - address review comments, simplifying code Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D51949 Files: clang-tidy/readability/CMakeLists.txt clang-tidy/readability/IsolateDeclarationCheck.cpp clan

[PATCH] D52971: [clang-tidy] Customize FileCheck prefix in check_clang-tidy.py to support multiple prefixes

2018-10-08 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. The change looks good in principle. I think it would make sense to migrate one test already, to use the new capability and check if everything works as expected. The current tests still run fine? Comment at: test/clang-tidy/check_clang_tidy.py:112 +

[PATCH] D52727: [clang-tidy] White List Option for performance-unnecessary-value-param, performance-unnecessary-copy-initialization and performance-for-range-copy

2018-10-09 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added inline comments. Comment at: clang-tidy/performance/UnnecessaryCopyInitialization.cpp:65-66 has(varDecl(hasLocalStorage(), - hasType(matchers::isExpensiveToCopy()), + hasTy

[PATCH] D52892: [Clang-tidy] readability check to convert numerical constants to std::numeric_limits

2018-10-09 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added inline comments. Comment at: clang-tidy/readability/NumericalCostantsToMaxIntCheck.cpp:63 + const auto *Lit = Result.Nodes.getNodeAs("Literal"); + assert(Decl != nullptr); + std::string InsteadOf = "-1"; please assert `Lit` as well and add an e

[PATCH] D57571: [clang-tidy] A new OpenMP module

2019-02-01 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth accepted this revision. JonasToth added a comment. This revision is now accepted and ready to land. LGTM. Committing both revision together would be good :) Repository: rCTE Clang Tools Extra CHANGES SINCE LAST ACTION https://reviews.llvm.org/D57571/new/ https://reviews.llvm.org/

[PATCH] D57665: [clang-tidy] Handle unions with existing default-member-init

2019-02-03 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth accepted this revision. JonasToth added a comment. This revision is now accepted and ready to land. LGTM, please close the bug report and notify for the fix with the request to check in the real-project if it actually fixes the issue. Thanks :) Repository: rG LLVM Github Monorepo C

[PATCH] D57787: [clang-tidy] modernize-avoid-c-arrays: avoid main function (PR40604)

2019-02-05 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added inline comments. Comment at: clang-tidy/modernize/AvoidCArraysCheck.cpp:35 + const clang::DeclContext *DC = Node.getDeclContext(); + const clang::FunctionDecl *FD = llvm::dyn_cast(DC); + if (!FD) There is `FunctionDecl->castToDeclContext()` whi

[PATCH] D57787: [clang-tidy] modernize-avoid-c-arrays: avoid main function (PR40604)

2019-02-06 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added inline comments. Comment at: clang-tidy/modernize/AvoidCArraysCheck.cpp:35 + const clang::DeclContext *DC = Node.getDeclContext(); + const clang::FunctionDecl *FD = llvm::dyn_cast(DC); + if (!FD) lebedev.ri wrote: > lebedev.ri wrote: > > JonasT

[PATCH] D57852: [clang-tidy] Don't use assignment for value-initialized enums

2019-02-07 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. How are the semantics for `enum class` in this case? Comment at: clang-tools-extra/test/clang-tidy/modernize-use-default-member-init-assignment.cpp:172 + // CHECK-FIXES: PositiveValueEnum() {} + Enum e; + // CHECK-MESSAGES: :[[@LINE-1]]:8: warnin

[PATCH] D57883: [clang-tidy] refactor ExceptionAnalyzer further to give ternary answer

2019-02-07 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth created this revision. JonasToth added reviewers: lebedev.ri, aaron.ballman, baloghadamsoftware, alexfh. Herald added subscribers: cfe-commits, dkrupp, donat.nagy, Szelethus, a.sidorin, rnkovacs, xazax.hun. Herald added a project: clang. The analsis on the throwing behvaiour on functio

[PATCH] D57883: [clang-tidy] refactor ExceptionAnalyzer further to give ternary answer

2019-02-07 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth marked 2 inline comments as done. JonasToth added inline comments. Comment at: clang-tidy/utils/ExceptionAnalyzer.h:31-192 +enum class ExceptionState : std::int8_t { + Throwing,///< The function can definitly throw given an AST. + NotThrowing, ///< This function c

[PATCH] D54395: [clang-tidy] implement utility-function to add 'const' to variables

2019-02-07 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. Herald added a project: clang. ping Repository: rCTE Clang Tools Extra CHANGES SINCE LAST ACTION https://reviews.llvm.org/D54395/new/ https://reviews.llvm.org/D54395 ___ cfe-commits mailing list cfe-commits@lists.llv

[PATCH] D57883: [clang-tidy] refactor ExceptionAnalyzer further to give ternary answer

2019-02-08 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth marked 2 inline comments as done. JonasToth added a comment. Good idea :) Repository: rCTE Clang Tools Extra CHANGES SINCE LAST ACTION https://reviews.llvm.org/D57883/new/ https://reviews.llvm.org/D57883 ___ cfe-commits mailing list

[PATCH] D57883: [clang-tidy] refactor ExceptionAnalyzer further to give ternary answer

2019-02-08 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 185939. JonasToth added a comment. - [Refactor] move support classes into the analyzer - [Refactor] move bigger methods into implementation file Repository: rCTE Clang Tools Extra CHANGES SINCE LAST ACTION https://reviews.llvm.org/D57883/new/ https:/

[PATCH] D57852: [clang-tidy] Don't use assignment for value-initialized enums

2019-02-08 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth accepted this revision. JonasToth added a comment. This revision is now accepted and ready to land. LGTM Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D57852/new/ https://reviews.llvm.org/D57852 _

[PATCH] D57662: [clang-tidy] Parallelise clang-tidy-diff.py

2019-02-13 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. In D57662#1392509 , @MyDeveloperDay wrote: > Just a question.. If clang tidy is running with -fix in parallel, what stops > each clang-tidy invocation altering a common header at the same time? `clang-apply-replacements` does

[PATCH] D57662: [clang-tidy] Parallelise clang-tidy-diff.py

2019-02-14 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added inline comments. Comment at: clang-tidy/tool/clang-tidy-diff.py:51 + + if not timeout is None: +watchdog = threading.Timer(timeout, proc.kill) `if timeout is not None` is more readable. Comment at: clang-tidy/tool/c

[PATCH] D57883: [clang-tidy] refactor ExceptionAnalyzer further to give ternary answer

2019-02-14 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. ping :) Repository: rCTE Clang Tools Extra CHANGES SINCE LAST ACTION https://reviews.llvm.org/D57883/new/ https://reviews.llvm.org/D57883 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org

[PATCH] D57966: [clang-tidy] add camelBackOrCase casing style to readability-identifier-naming to support change to variable naming policy (if adopted)

2019-02-14 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added inline comments. Herald added a subscriber: jdoerfert. Comment at: test/clang-tidy/readability-identifier-naming-camelback-or-case.cpp:97 +class aB_def +// CHECK-MESSAGES: :[[@LINE-1]]:7: warning: invalid case style +{ why no test for fixing? R

[PATCH] D58137: [clang-tidy] Add the abseil-time-subtraction check

2019-02-16 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added inline comments. Comment at: clang-tidy/abseil/DurationRewriter.cpp:92 + DurationScale Scale, const Expr &Node) { + const llvm::StringRef &InverseFunction = getTimeInverseForScale(Scale); + if (const auto *MaybeCallArg = selectFirst( --

[PATCH] D58137: [clang-tidy] Add the abseil-time-subtraction check

2019-02-16 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added inline comments. Comment at: clang-tidy/abseil/TimeSubtractionCheck.cpp:72 + +// Match the cases where we know that the result is a Duration and the first +// argument is a Time. Just knowing the type of the first operand is not Eugene.Z

[PATCH] D57883: [clang-tidy] refactor ExceptionAnalyzer further to give ternary answer

2019-02-20 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 187634. JonasToth marked 2 inline comments as done. JonasToth added a comment. - [Refactor] move support classes into the analyzer - [Refactor] move bigger methods into implementation file - minor adjustments Repository: rCTE Clang Tools Extra CHANGES S

[PATCH] D57883: [clang-tidy] refactor ExceptionAnalyzer further to give ternary answer

2019-02-20 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth marked 3 inline comments as done. JonasToth added a comment. all comments resolved. I will land this now. Comment at: clang-tidy/utils/ExceptionAnalyzer.h:26-31 + enum class State : std::int8_t { +Throwing,///< The function can definitly throw given an AST. +

[PATCH] D57883: [clang-tidy] refactor ExceptionAnalyzer further to give ternary answer

2019-02-20 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 187635. JonasToth marked an inline comment as done. JonasToth added a comment. - be explicit about the State enumerator values Repository: rCTE Clang Tools Extra CHANGES SINCE LAST ACTION https://reviews.llvm.org/D57883/new/ https://reviews.llvm.org/

[PATCH] D57883: [clang-tidy] refactor ExceptionAnalyzer further to give ternary answer

2019-02-20 Thread Jonas Toth via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rCTE354517: [clang-tidy] refactor ExceptionAnalyzer further to give ternary answer (authored by JonasToth, committed by ). Changed prior to commit: https://reviews.llvm.org/D57883?vs=187635&id=187662#toc

[PATCH] D58137: [clang-tidy] Add the abseil-time-subtraction check

2019-02-23 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added inline comments. Comment at: clang-tidy/abseil/TimeSubtractionCheck.cpp:97 +void TimeSubtractionCheck::check(const MatchFinder::MatchResult &Result) { + const auto *BinOp = Result.Nodes.getNodeAs("binop"); + std::string inverse_name = hwright wr

[PATCH] D36354: [clang-tidy] Implement type-based check for `gsl::owner`

2017-08-26 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added inline comments. Comment at: clang-tidy/cppcoreguidelines/OwningMemoryCheck.cpp:294 + +diag(BadClass->getLocStart(), + "class with an 'gsl::owner<>' as member but without declared " aaron.ballman wrote: > Instead of diagnosing this on

[PATCH] D37060: [clang-tidy] Improve hicpp-exception-baseclass to handle generic code better

2017-08-30 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added inline comments. Comment at: test/clang-tidy/hicpp-exception-baseclass.cpp:26 } throw non_derived_exception(); // Bad + // CHECK-MESSAGES: [[@LINE-1]]:9: warning: throwing an exception whose type 'non_derived_exception' is not derived from 'std::exception'

[PATCH] D37060: [clang-tidy] Improve hicpp-exception-baseclass to handle generic code better

2017-08-30 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 113212. JonasToth marked 2 inline comments as done. JonasToth added a comment. - removing trailing comments https://reviews.llvm.org/D37060 Files: test/clang-tidy/hicpp-exception-baseclass.cpp Index: test/clang-tidy/hicpp-exception-baseclass.cpp ==

[PATCH] D37060: [clang-tidy] Improve hicpp-exception-baseclass to handle generic code better

2017-08-30 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 113213. JonasToth added a comment. fix patch, to diff against master again https://reviews.llvm.org/D37060 Files: clang-tidy/hicpp/ExceptionBaseclassCheck.cpp test/clang-tidy/hicpp-exception-baseclass.cpp Index: test/clang-tidy/hicpp-exception-basecl

[PATCH] D37060: [clang-tidy] Improve hicpp-exception-baseclass to handle generic code better

2017-08-30 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 113214. JonasToth added a comment. struggling with arc... https://reviews.llvm.org/D37060 Files: clang-tidy/hicpp/ExceptionBaseclassCheck.cpp test/clang-tidy/hicpp-exception-baseclass.cpp Index: test/clang-tidy/hicpp-exception-baseclass.cpp =

[PATCH] D36354: [clang-tidy] Implement type-based check for `gsl::owner`

2017-08-30 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 113217. JonasToth marked 5 inline comments as done. JonasToth added a comment. - fix spelling and grammar errors - adjust unit test to new diagnostics https://reviews.llvm.org/D36354 Files: clang-tidy/cppcoreguidelines/CMakeLists.txt clang-tidy/cppcor

[PATCH] D36354: [clang-tidy] Implement type-based check for `gsl::owner`

2017-08-30 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. addressed some issues, not all yet https://reviews.llvm.org/D36354 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D36586: [clang-tidy] hicpp bitwise operations on signed integers

2017-08-30 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added inline comments. Comment at: clang-tidy/hicpp/SignedBitwiseCheck.cpp:23 + const auto SignedIntegerOperand = + expr(ignoringImpCasts(hasType(isSignedInteger(.bind("signed_operand"); + JonasToth wrote: > aaron.ballman wrote: > > JonasToth

[PATCH] D37210: [refactor] add a refactoring action rule that returns symbol occurrences

2017-08-30 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth resigned from this revision. JonasToth added a comment. This revision is now accepted and ready to land. sry. misconfigured herald :( Repository: rL LLVM https://reviews.llvm.org/D37210 ___ cfe-commits mailing list cfe-commits@lists.llv

[PATCH] D37060: [clang-tidy] Improve hicpp-exception-baseclass to handle generic code better

2017-08-30 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added inline comments. Comment at: test/clang-tidy/hicpp-exception-baseclass.cpp:54-62 +// CHECK-MESSAGES: [[@LINE-1]]:31: warning: throwing an exception whose type 'bad_generic_exception' is not derived from 'std::exception' +// CHECK-MESSAGES: 71:1: note: type define

[PATCH] D36892: [clang-tidy] check_clang_tidy.py: support CHECK-NOTES prefix

2017-08-30 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. Note can be handled right now as well. E.g. // CHECK-MESSAGES: [[@LINE-2]]:3: note: type deduction did not result in an owner would the patch handle the codelocation correctly? Repository: rL LLVM https://reviews.llvm.org/D36892 _

[PATCH] D37060: [clang-tidy] Improve hicpp-exception-baseclass to handle generic code better

2017-08-30 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. @aaron.ballman is it ok for you as well? otherwise i would commit it. https://reviews.llvm.org/D37060 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D36892: [clang-tidy] check_clang_tidy.py: support CHECK-NOTES prefix

2017-08-30 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. alright. i thought it would do something different, but the enforcement to handle all notes is a good thing. forget what i wrote :) Repository: rL LLVM https://reviews.llvm.org/D36892 ___ cfe-commits mailing list cfe-c

[PATCH] D36586: [clang-tidy] hicpp bitwise operations on signed integers

2017-08-30 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 113246. JonasToth marked 8 inline comments as done. JonasToth added a comment. - added additional testcases, like @aaron.ballman requested - fixed diagnostics https://reviews.llvm.org/D36586 Files: clang-tidy/hicpp/CMakeLists.txt clang-tidy/hicpp/HICP

[PATCH] D36586: [clang-tidy] hicpp bitwise operations on signed integers

2017-08-30 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth marked an inline comment as done. JonasToth added inline comments. Comment at: test/clang-tidy/hicpp-signed-bitwise.cpp:205 + +#if 0 +// Scoped Enums must define their operations, so the overloaded operators must take care aaron.ballman wrote: > I don'

<    3   4   5   6   7   8   9   10   11   12   >