[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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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
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] 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#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] 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] 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 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. 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] 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] 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] 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] 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] 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] 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] 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 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] 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] 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] 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] 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 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] 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 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] D52684: [clang-tidy] NFC refactor lexer-utils slightly to be easier to use

2018-09-29 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 167592. JonasToth added a comment. - fix missing file Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D52684 Files: clang-tidy/bugprone/ArgumentCommentCheck.cpp clang-tidy/bugprone/SuspiciousSemicolonCheck.cpp clang-tidy/cppcoreguidel

[PATCH] D36836: [clang-tidy] Implement sonarsource-function-cognitive-complexity check

2018-09-29 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. Anything new here? Is there a LLVM foundation lawyer or something like that we can ask? Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D36836 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://

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

2018-09-29 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 167591. JonasToth added a comment. - remove changes from lexerutils refactoring in other checks Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D51949 Files: clang-tidy/readability/CMakeLists.txt clang-tidy/readability/IsolateDeclaratio

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

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. JonasToth added a project: clang-tools-extra. This patch is a small refactoring necessary for 'readability-isolate-declaration' and does n

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

2018-09-29 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 167589. JonasToth added a comment. - fix spurious changes Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D51949 Files: clang-tidy/bugprone/ArgumentCommentCheck.cpp clang-tidy/bugprone/SuspiciousSemicolonCheck.cpp clang-tidy/cppcoregu

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

2018-09-29 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 167588. JonasToth marked 2 inline comments as done. JonasToth added a comment. - address review comments Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D51949 Files: clang-tidy/bugprone/ArgumentCommentCheck.cpp clang-tidy/bugprone/Susp

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

2018-09-29 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth marked 15 inline comments as done. JonasToth added inline comments. Comment at: clang-tidy/readability/IsolateDeclarationCheck.cpp:52 + const LangOptions &LangOpts) { + assert(Indirections >= 0 && "Indirections must be non-ne

[PATCH] D52676: [clang-format] tweaked another case of lambda formatting

2018-09-29 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. Please upload the patch with full context (i belive `diff -c 999`) Comment at: lib/Format/TokenAnnotator.cpp:3054 + return true; +else if (!Style.BinPackArguments) + return true; please no `else` after return. You ca

[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. Thanks for working on this! Related as well: http://www.codingstandard.com/rule/4-2-1-ensure-that-the-u-suffix-is-applied-to-a-literal-used-in-a-context-requiring-an-unsigned-integral-expression/ I think its wort a alias is hicpp as well Please add tests that use user

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

2018-09-28 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 167523. JonasToth added a comment. - simplify matcher slighty, as initStmt in if/switch don't have a compundstmt as parent, add suggested tests Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D51949 Files: clang-tidy/bugprone/ArgumentCom

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

2018-09-28 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added inline comments. Comment at: docs/clang-tidy/checks/readability-isolate-declaration.rst:33 + for (int Begin = 0, End = 100; Begin < End; ++Begin); + it (int Begin = 42, Result = some_function(Begin); Begin == Result); + typo mention `if () int i

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

2018-09-28 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. llvm and clang look fine as well. No miscompilation after fixing, tests run as well. (i do exclude all targets except x86 for build-speed) F7327680: cfe_isolated_decl.patch F7327681: llvm_isolated_decl.patch

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

2018-09-28 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 167491. JonasToth added a comment. Herald added subscribers: jsji, kbarton, nemanjai. - fix paren issue, introduced non-local changes i will extract and post in a separate patch - remove debug output for paren search Repository: rCTE Clang Tools Extra

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

2018-09-28 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. Blender looks better now, code compiles after full transformation F7327473: blender_isolated_decls.patch Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D51949 ___ cfe-co

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

2018-09-28 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. LLVM works, Blender doesn't, the offending piece is `float (((*f_ptr2)))[42], *f_ptr3, f_value2 = 42.f;` (parens around the pointer). I am trying to fix that. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D51949

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

2018-09-28 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 167445. JonasToth added a comment. - add tests for auto and decltype - rename check to 'readability-isolate-declaration' Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D51949 Files: clang-tidy/readability/CMakeLists.txt clang-tidy/read

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

2018-09-28 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added inline comments. Comment at: test/clang-tidy/readability-isolate-decl.cpp:184 + + int member1, member2; + // TODO: Transform FieldDecl's as well @lebedev.ri :P Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D51949 __

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

2018-09-28 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added inline comments. Comment at: clang-tidy/readability/IsolateDeclCheck.cpp:343 + auto Diag = + diag(WholeDecl->getBeginLoc(), "this statement declares %0 variables") + << static_cast( lebedev.ri wrote: > JonasToth wrote: > > aaron.ballman

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

2018-09-28 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. In https://reviews.llvm.org/D51949#1248850, @lebedev.ri wrote: > I have looked through tests, and it is possible that i just missed it, but > does it test/handle the cases like: > > struct S { > int X, Y, Z; // <- should be diagnosed. > } > Unfortunatly not

[PATCH] D27621: [clang-tidy] check to find declarations declaring more than one name

2018-09-28 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. Hi @firolino, I implemented a less general version of you check https://reviews.llvm.org/D51949 as I wanted to achieve a slightly different goal (and this revision seems to be abonded). My aim is to have general transformation capabilities to separate declarations (va

[PATCH] D51949: [WIP][clang-tidy] initial ideas to isolate variable declarations

2018-09-28 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 167437. JonasToth added a comment. - write user-facing documentation Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D51949 Files: clang-tidy/readability/CMakeLists.txt clang-tidy/readability/IsolateDeclCheck.cpp clang-tidy/readabilit

[PATCH] D51949: [WIP][clang-tidy] initial ideas to isolate variable declarations

2018-09-27 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 167400. JonasToth added a comment. - last cleanup for today, testing on clang/lib looks good, but is already very clean Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D51949 Files: clang-tidy/readability/CMakeLists.txt clang-tidy/read

[PATCH] D51949: [WIP][clang-tidy] initial ideas to isolate variable declarations

2018-09-27 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 167397. JonasToth added a comment. - fix doc typo Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D51949 Files: clang-tidy/readability/CMakeLists.txt clang-tidy/readability/IsolateDeclCheck.cpp clang-tidy/readability/IsolateDeclCheck.

[PATCH] D51949: [WIP][clang-tidy] initial ideas to isolate variable declarations

2018-09-27 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 167389. JonasToth added a comment. - bail out in transformation if there are PP directives in the source range of the DeclStmt Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D51949 Files: clang-tidy/readability/CMakeLists.txt clang-ti

[PATCH] D51949: [WIP][clang-tidy] initial ideas to isolate variable declarations

2018-09-27 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth marked 9 inline comments as done. JonasToth added inline comments. Comment at: clang-tidy/readability/IsolateDeclCheck.cpp:211 + std::vector Snippets; + Snippets.reserve(Ranges.size()); + kbobyrev wrote: > nit: It would be probably easier to have `Sni

[PATCH] D51949: [WIP][clang-tidy] initial ideas to isolate variable declarations

2018-09-27 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 167381. JonasToth marked 9 inline comments as done. JonasToth added a comment. - simplification on FIXME:/TODO: Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D51949 Files: clang-tidy/readability/CMakeLists.txt clang-tidy/readability/I

[PATCH] D51949: [WIP][clang-tidy] initial ideas to isolate variable declarations

2018-09-27 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added inline comments. Comment at: clang-tidy/readability/IsolateDeclCheck.cpp:343 + auto Diag = + diag(WholeDecl->getBeginLoc(), "this statement declares %0 variables") + << static_cast( aaron.ballman wrote: > JonasToth wrote: > > kbobyrev w

[PATCH] D51949: [WIP][clang-tidy] initial ideas to isolate variable declarations

2018-09-27 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 167377. JonasToth added a comment. - address review comments, most nits solved - fix typedefs and function pointers with comments as distraction - make memberpointer detection more accurate - move functioning member pointer test - clean debug output - clean

[PATCH] D51949: [WIP][clang-tidy] initial ideas to isolate variable declarations

2018-09-27 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth marked 11 inline comments as done. JonasToth added inline comments. Comment at: clang-tidy/readability/IsolateDeclCheck.cpp:68 +if (Start.isInvalid() || Start.isMacroID()) + return SourceLocation(); + } kbobyrev wrote: > Also, I don't think th

[PATCH] D51949: [WIP][clang-tidy] initial ideas to isolate variable declarations

2018-09-27 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added inline comments. Comment at: clang-tidy/readability/IsolateDeclCheck.cpp:343 + auto Diag = + diag(WholeDecl->getBeginLoc(), "this statement declares %0 variables") + << static_cast( kbobyrev wrote: > aaron.ballman wrote: > > lebedev.ri

[PATCH] D51949: [WIP][clang-tidy] initial ideas to isolate variable declarations

2018-09-27 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. There are testcases with macro around line 100 in the default tests. I am not sure yet if `#define I_DECLS int i1, i2, i3;` should be diagnosed, but the other cases should. Am 27.09.2018 um 16:28 schrieb Kirill Bobyrev via Phabricator: > kbobyrev added a comment. > >

[PATCH] D52334: [clang-tidy] Build it even without static analyzer

2018-09-27 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. In https://reviews.llvm.org/D52334#1247809, @steveire wrote: > @JonasToth Once again - `clangStaticAnalyzerCheckers` is not `clangAnalysis`. > Also, that commit changes the `mpi` plugin, which is excluded by this patch. I pinged because of the MPI thing, i did not lo

[PATCH] D52229: [clang-tidy] use CHECK-NOTES in tests for bugprone suspicious-enum-usage

2018-09-27 Thread Jonas Toth via Phabricator via cfe-commits
This revision was not accepted when it landed; it landed in state "Needs Review". This revision was automatically updated to reflect the committed changes. Closed by commit rL343201: [clang-tidy] use CHECK-NOTES in tests for bugprone suspicious-enum-usage (authored by JonasToth, committed by ). H

[PATCH] D52228: [clang-tidy] use CHECK-NOTES in tests for bugprone-use-after-move

2018-09-27 Thread Jonas Toth via Phabricator via cfe-commits
This revision was not accepted when it landed; it landed in state "Needs Review". This revision was automatically updated to reflect the committed changes. Closed by commit rL343199: [clang-tidy] use CHECK-NOTES in tests for bugprone-use-after-move (authored by JonasToth, committed by ). Herald a

[PATCH] D52185: [clang-tidy] use CHECK-NOTES in tests for bugprone-forward-declaration-namespace

2018-09-27 Thread Jonas Toth via Phabricator via cfe-commits
This revision was not accepted when it landed; it landed in state "Needs Review". This revision was automatically updated to reflect the committed changes. Closed by commit rL343198: [clang-tidy] use CHECK-NOTES in tests for bugprone-forward-declaration-namespace (authored by JonasToth, committed

[PATCH] D51949: [WIP][clang-tidy] initial ideas to isolate variable declarations

2018-09-27 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 167282. JonasToth marked 3 inline comments as done. JonasToth added a comment. - add space after clang-tidy in banner - refactor slightly, add better in-code comments to explain whats happening, add more TODOs and FIXMEs Repository: rCTE Clang Tools Ext

[PATCH] D51949: [WIP][clang-tidy] initial ideas to isolate variable declarations

2018-09-27 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 167270. JonasToth marked 6 inline comments as done. JonasToth added a comment. - move lexer stuff into LexerUtils - remove custom string handling function - address review comments Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D51949 File

[PATCH] D51949: [WIP][clang-tidy] initial ideas to isolate variable declarations

2018-09-27 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added inline comments. Comment at: clang-tidy/readability/IsolateDeclCheck.cpp:21 + +#define PRINT_DEBUG 1 + kbobyrev wrote: > Do you plan to submit the patch with debugging messages or are you just using > these for better local debugging experience?

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

2018-09-27 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. LGTM, with a few nits and a question. Please wait a bit if @aaron.ballman or @george.karpenkov have any comments before committing. Comment at: lib/Analysis/ExprMutationAnalyzer.cpp:88 +bool isPointeeMutable(const Expr *Exp, const ASTContext &Context

[PATCH] D52334: [clang-tidy] Build it even without static analyzer

2018-09-27 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. There has been a commit that seems related: https://reviews.llvm.org/rL343168 @steveire could you please take a look at how it affects this patch? Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D52334 ___ c

[PATCH] D52334: [clang-tidy] Build it even without static analyzer

2018-09-26 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. Please wait for explicit approval from @alexfh Am 26.09.2018 um 13:05 schrieb Stephen Kelly via Phabricator: > steveire added a comment. > > Can I go ahead and merge this now? > > Repository: > > rCTE Clang Tools Extra > > https://reviews.llvm.org/D52334 Reposi

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