Re: [PATCH] D19014: [clang-tidy] Add new checker for suspicious sizeof expressions

2016-04-13 Thread Malcolm Parsons via cfe-commits
malcolm.parsons added a subscriber: malcolm.parsons. Comment at: docs/clang-tidy/checks/misc-sizeof-expression.rst:16 @@ +15,3 @@ +A common mistake is to query the ``sizeof`` of an integer literal. This is +equivalent to query the size of it's type (probably ``int``). The intent

Re: [PATCH] D23343: [clang-tidy] modernize-make-{smart_ptr} private ctor bugfix

2016-08-17 Thread Malcolm Parsons via cfe-commits
malcolm.parsons added a subscriber: malcolm.parsons. Comment at: clang-tidy/modernize/MakeSmartPtrCheck.cpp:32-33 @@ -31,1 +31,4 @@ + // Calling make_smart_ptr from within a member function of a type with a + // private or protected constructor would be ill-formed. + auto

[clang-tools-extra] r292786 - [clang-tidy] Ignore implicit functions in performance-unnecessary-value-param

2017-01-23 Thread Malcolm Parsons via cfe-commits
Author: malcolm.parsons Date: Mon Jan 23 07:18:08 2017 New Revision: 292786 URL: http://llvm.org/viewvc/llvm-project?rev=292786=rev Log: [clang-tidy] Ignore implicit functions in performance-unnecessary-value-param Summary: The performance-unnecessary-value-param check mangled inherited

Re: r291905 - [Sema] Add warning for unused lambda captures

2017-01-22 Thread Malcolm Parsons via cfe-commits
On 20 January 2017 at 21:32, Nico Weber wrote: > This warns about code like > > constexpr int foo = 4; > []() { use(foo); } > > That's correct, but removing then makes MSVC complain about this code > like "error C3493: 'foo' cannot be implicitly captured because no

[clang-tools-extra] r295192 - [clang-tidy] Don't delay parsing of templates in test for misc-unconventional-assign-operator

2017-02-15 Thread Malcolm Parsons via cfe-commits
Author: malcolm.parsons Date: Wed Feb 15 10:32:55 2017 New Revision: 295192 URL: http://llvm.org/viewvc/llvm-project?rev=295192=rev Log: [clang-tidy] Don't delay parsing of templates in test for misc-unconventional-assign-operator Modified:

[clang-tools-extra] r295176 - [clang-tidy] Don't warn about call to unresolved operator*

2017-02-15 Thread Malcolm Parsons via cfe-commits
Author: malcolm.parsons Date: Wed Feb 15 08:01:41 2017 New Revision: 295176 URL: http://llvm.org/viewvc/llvm-project?rev=295176=rev Log: [clang-tidy] Don't warn about call to unresolved operator* Summary: The misc-unconventional-assign-operator check had a false positive warning when the

r292477 - [docs] Tell Doxygen to expand LLVM_ALIGNAS to nothing

2017-01-19 Thread Malcolm Parsons via cfe-commits
Author: malcolm.parsons Date: Thu Jan 19 03:27:45 2017 New Revision: 292477 URL: http://llvm.org/viewvc/llvm-project?rev=292477=rev Log: [docs] Tell Doxygen to expand LLVM_ALIGNAS to nothing Summary: Docs for clang::Decl and clang::TemplateSpecializationType have not been generated since

Re: [PATCH] D28467: [Sema] Add warning for unused lambda captures

2017-01-19 Thread Malcolm Parsons via cfe-commits
On 19 January 2017 at 03:47, Aaron Ballman wrote: > It is not used in an unevaluated context -- that is a bug. It is an evaluated expression, but is it odr-used? C++14 [basic.def.odr] p3: A variable x whose name appears as a potentially-evaluated expression ex is

Re: [PATCH] D28467: [Sema] Add warning for unused lambda captures

2017-01-19 Thread Malcolm Parsons via cfe-commits
On 19 January 2017 at 12:49, Aaron Ballman wrote: > You are correct, it is not an odr use. MSVC is wrong to require the capture. Should the warning be rephrased? -- Malcolm Parsons ___ cfe-commits mailing list

Re: [PATCH] D28467: [Sema] Add warning for unused lambda captures

2017-01-19 Thread Malcolm Parsons via cfe-commits
On 19 January 2017 at 13:16, Aaron Ballman wrote: > I wasn't thinking about that kind of odr-unuse when reviewing your > patch, so I am starting to think that perhaps it's not worth > distinguishing unevaluated contexts or not in the diagnostic. :-( If > we could do it,

[clang-tools-extra] r292484 - [docs] Tell Doxygen to expand LLVM_ALIGNAS to nothing

2017-01-19 Thread Malcolm Parsons via cfe-commits
Author: malcolm.parsons Date: Thu Jan 19 07:38:19 2017 New Revision: 292484 URL: http://llvm.org/viewvc/llvm-project?rev=292484=rev Log: [docs] Tell Doxygen to expand LLVM_ALIGNAS to nothing Summary: Docs for clang::Decl and clang::TemplateSpecializationType have not been generated since

r292498 - [Sema] Reword unused lambda capture warning

2017-01-19 Thread Malcolm Parsons via cfe-commits
Author: malcolm.parsons Date: Thu Jan 19 11:19:22 2017 New Revision: 292498 URL: http://llvm.org/viewvc/llvm-project?rev=292498=rev Log: [Sema] Reword unused lambda capture warning Summary: The warning doesn't know why the variable was looked up but not odr-used, so reword it to not claim that

r292595 - Fix documentation typo.

2017-01-20 Thread Malcolm Parsons via cfe-commits
Author: malcolm.parsons Date: Fri Jan 20 03:54:26 2017 New Revision: 292595 URL: http://llvm.org/viewvc/llvm-project?rev=292595=rev Log: Fix documentation typo. Modified: cfe/trunk/docs/LibASTMatchersReference.html cfe/trunk/include/clang/ASTMatchers/ASTMatchers.h Modified:

r296602 - [Sema] Improve side effect checking for unused-lambda-capture warning

2017-03-01 Thread Malcolm Parsons via cfe-commits
Author: malcolm.parsons Date: Wed Mar 1 04:23:38 2017 New Revision: 296602 URL: http://llvm.org/viewvc/llvm-project?rev=296602=rev Log: [Sema] Improve side effect checking for unused-lambda-capture warning Summary: Don't warn about unused lambda captures that involve copying a value of a type

[PATCH] D24444: [clang-tidy] modernize-use-default default constructor bugfix

2016-09-11 Thread Malcolm Parsons via cfe-commits
malcolm.parsons created this revision. malcolm.parsons added a reviewer: klimek. malcolm.parsons added subscribers: cfe-commits, klimek, alexfh. Only member initializers that are written should prevent using '= default' on a default constructor. https://reviews.llvm.org/D2 Files:

Re: [PATCH] D24500: [clang-tidy] Bugfix for readability-redundant-control-flow check

2016-09-14 Thread Malcolm Parsons via cfe-commits
malcolm.parsons added a comment. I didn't report a bug for this issue, and there isn't an existing one. https://reviews.llvm.org/D24500 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

Re: [PATCH] D24339: [clang-tidy] Add check 'readability-redundant-member-init'

2016-09-08 Thread Malcolm Parsons via cfe-commits
malcolm.parsons added a comment. How do I add FixIt hints? They should be simple removals, but how do I decide whether to remove the following comma, preceding comma or preceding colon? Comment at: clang-tidy/readability/RedundantMemberInitCheck.cpp:33 @@ +32,3 @@ + const

[PATCH] D24500: [clang-tidy] Bugfix for readability-redundant-control-flow check

2016-09-13 Thread Malcolm Parsons via cfe-commits
malcolm.parsons created this revision. malcolm.parsons added reviewers: sbenza, aaron.ballman, alexfh. malcolm.parsons added subscribers: Eugene.Zelenko, cfe-commits, beanz. This check did not create FixItHints when the statement before the redundant control flow was not followed by a semicolon.

[PATCH] D24652: [clang-tidy] readability-avoid-const-params-in-decls template instantiation bugfix

2016-09-16 Thread Malcolm Parsons via cfe-commits
malcolm.parsons created this revision. malcolm.parsons added reviewers: alexfh, aaron.ballman, hokein. malcolm.parsons added a subscriber: cfe-commits. Bugfix for 30398. Don't warn for template instantiations https://reviews.llvm.org/D24652 Files:

Re: [PATCH] D24444: [clang-tidy] modernize-use-default default constructor bugfix

2016-09-26 Thread Malcolm Parsons via cfe-commits
malcolm.parsons added a comment. I don't have commit access, so please commit this and https://reviews.llvm.org/D24652 for me. Thanks. https://reviews.llvm.org/D2 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

Re: [PATCH] D24887: [clang-tidy] cert-err58-cpp should not apply to function scope objects

2016-09-26 Thread Malcolm Parsons via cfe-commits
malcolm.parsons added a comment. I don't have commit access, so please commit it for me. Thanks. https://reviews.llvm.org/D24887 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] [Updated, 96 lines] D24965: [clang-tidy] Fix cppcoreguidelines-pro-type-member-init false negatives

2016-09-30 Thread Malcolm Parsons via cfe-commits
malcolm.parsons updated this revision to Diff 73019. malcolm.parsons added a comment. Rebase https://reviews.llvm.org/D24965 Files: clang-tidy/cppcoreguidelines/ProTypeMemberInitCheck.cpp clang-tidy/cppcoreguidelines/ProTypeMemberInitCheck.h clang-tidy/utils/TypeTraits.cpp

[PATCH] D25316: [clang-tidy] Fix PR25499: Enhance modernize-use-auto to casts

2016-10-06 Thread Malcolm Parsons via cfe-commits
malcolm.parsons updated this revision to Diff 73780. malcolm.parsons added a comment. Add functional casts to tests and doc. https://reviews.llvm.org/D25316 Files: clang-tidy/modernize/UseAutoCheck.cpp clang-tidy/modernize/UseAutoCheck.h docs/clang-tidy/checks/modernize-use-auto.rst

[PATCH] D25316: [clang-tidy] Fix PR25499: Enhance modernize-use-auto to casts

2016-10-06 Thread Malcolm Parsons via cfe-commits
malcolm.parsons created this revision. malcolm.parsons added reviewers: angelgarcia, aaron.ballman, klimek. malcolm.parsons added subscribers: cfe-commits, Eugene.Zelenko. Extend modernize-use-auto to cases when variable is assigned with cast. e.g. Type *Ptr1 = dynamic_cast(Ptr2);

[PATCH] D24965: [clang-tidy] Fix cppcoreguidelines-pro-type-member-init false negatives

2016-10-04 Thread Malcolm Parsons via cfe-commits
malcolm.parsons updated this revision to Diff 73452. malcolm.parsons added a comment. Don't match template instantiations. Add assert message. Update macro comment. Add tests for templates and macros. https://reviews.llvm.org/D24965 Files:

[PATCH] D24339: [clang-tidy] Add check 'readability-redundant-member-init'

2016-10-04 Thread Malcolm Parsons via cfe-commits
malcolm.parsons updated this revision to Diff 73479. malcolm.parsons added a comment. Add test for initializing a union member. Add test for multiple inheritance. https://reviews.llvm.org/D24339 Files: clang-tidy/readability/CMakeLists.txt clang-tidy/readability/ReadabilityTidyModule.cpp

[PATCH] D24965: [clang-tidy] Fix cppcoreguidelines-pro-type-member-init false negatives

2016-10-04 Thread Malcolm Parsons via cfe-commits
malcolm.parsons added a comment. In https://reviews.llvm.org/D24965#560785, @aaron.ballman wrote: > LGTM, thank you! I don't have commit access, so please commit this for me. Thanks. https://reviews.llvm.org/D24965 ___ cfe-commits mailing list

[PATCH] D24339: [clang-tidy] Add check 'readability-redundant-member-init'

2016-10-04 Thread Malcolm Parsons via cfe-commits
malcolm.parsons added inline comments. > aaron.ballman wrote in readability-redundant-member-init.cpp:162 > Missing a test for `union` member initializers. Also, a test that multiple > inheritance doesn't cause a fixit malfunction would be nice. Note that all the fixits malfunction until

[PATCH] D25363: Store a SourceRange for multi-token builtin types

2016-10-08 Thread Malcolm Parsons via cfe-commits
malcolm.parsons added a comment. In https://reviews.llvm.org/D25363#565371, @Prazek wrote: > Thanks for the patch! I think some unit test should be added. Are there any existing unit tests for TypeLoc that I can add to? > Do you also handle cases like > > unsigned long long Yes - see

[PATCH] D25363: Store a SourceRange for multi-token builtin types

2016-10-08 Thread Malcolm Parsons via cfe-commits
malcolm.parsons updated this revision to Diff 74047. malcolm.parsons added a comment. Replace TSWLoc with TSWRange https://reviews.llvm.org/D25363 Files: include/clang/AST/TypeLoc.h include/clang/Sema/DeclSpec.h lib/Sema/DeclSpec.cpp lib/Sema/SemaType.cpp Index: lib/Sema/SemaType.cpp

[PATCH] D25316: [clang-tidy] Fix PR25499: Enhance modernize-use-auto to casts

2016-10-06 Thread Malcolm Parsons via cfe-commits
malcolm.parsons updated this revision to Diff 73831. malcolm.parsons added a comment. Mention in release notes. https://reviews.llvm.org/D25316 Files: clang-tidy/modernize/UseAutoCheck.cpp clang-tidy/modernize/UseAutoCheck.h docs/clang-tidy/checks/modernize-use-auto.rst

[PATCH] D25316: [clang-tidy] Fix PR25499: Enhance modernize-use-auto to casts

2016-10-06 Thread Malcolm Parsons via cfe-commits
malcolm.parsons added a comment. In https://reviews.llvm.org/D25316#563654, @Eugene.Zelenko wrote: > I think will be good idea to handle LLVM casts and getAs<> methods too. There > are plenty of them in LLVM/Clang/etc code used for variable initialization. Yes. I plan to do that, but maybe in

[PATCH] D25363: Store a SourceRange for multi-token builtin types

2016-10-07 Thread Malcolm Parsons via cfe-commits
malcolm.parsons created this revision. malcolm.parsons added a reviewer: Prazek. malcolm.parsons added a subscriber: cfe-commits. clang-tidy's modernize-use-auto check uses the SourceRange of a TypeLoc when replacing the type with auto. This was producing the wrong result for multi-token builtin

[PATCH] D25316: [clang-tidy] Fix PR25499: Enhance modernize-use-auto to casts

2016-10-07 Thread Malcolm Parsons via cfe-commits
malcolm.parsons updated this revision to Diff 73918. malcolm.parsons added a comment. Add more tests. https://reviews.llvm.org/D25316 Files: clang-tidy/modernize/UseAutoCheck.cpp clang-tidy/modernize/UseAutoCheck.h docs/clang-tidy/checks/modernize-use-auto.rst

[PATCH] D25238: [clang-tidy] Ignore empty members and bases in cppcoreguidelines-pro-type-member-init

2016-10-04 Thread Malcolm Parsons via cfe-commits
malcolm.parsons created this revision. malcolm.parsons added reviewers: aaron.ballman, alexfh, mgehre. malcolm.parsons added a subscriber: cfe-commits. Herald added a subscriber: nemanjai. Empty/incomplete variables/members/bases don't need to be initialized https://reviews.llvm.org/D25238

[PATCH] D25316: [clang-tidy] Fix PR25499: Enhance modernize-use-auto to casts

2016-10-08 Thread Malcolm Parsons via cfe-commits
malcolm.parsons updated this revision to Diff 74022. malcolm.parsons added a comment. Rework handling of references https://reviews.llvm.org/D25316 Files: clang-tidy/modernize/UseAutoCheck.cpp clang-tidy/modernize/UseAutoCheck.h docs/clang-tidy/checks/modernize-use-auto.rst

[PATCH] D25316: [clang-tidy] Fix PR25499: Enhance modernize-use-auto to casts

2016-10-07 Thread Malcolm Parsons via cfe-commits
malcolm.parsons added a comment. In https://reviews.llvm.org/D25316#563930, @Prazek wrote: > Please add tests with > > long long p = static_cast(4); > > > and the same with const at beginning. I remember I had problems with this > last time (Type->SourceRange was returning only source

[PATCH] D25363: Store a SourceRange for multi-token builtin types

2016-10-10 Thread Malcolm Parsons via cfe-commits
malcolm.parsons updated this revision to Diff 74124. malcolm.parsons added a comment. Add unit tests https://reviews.llvm.org/D25363 Files: include/clang/AST/TypeLoc.h include/clang/Sema/DeclSpec.h lib/Sema/DeclSpec.cpp lib/Sema/SemaType.cpp unittests/AST/SourceLocationTest.cpp

[PATCH] D25316: [clang-tidy] Fix PR25499: Enhance modernize-use-auto to casts

2016-10-09 Thread Malcolm Parsons via cfe-commits
malcolm.parsons added a comment. In https://reviews.llvm.org/D25316#565567, @Prazek wrote: > functionDecl(hasName(LEXICAL_CAST_NAME), I was trying to avoid specifying the name of the function so that it works for any templated function/member function that returns its first template

Re: [PATCH] D24339: [clang-tidy] Add check 'readability-redundant-member-init'

2016-09-19 Thread Malcolm Parsons via cfe-commits
malcolm.parsons updated this revision to Diff 71802. malcolm.parsons added a comment. Handle delegating and base class constructors https://reviews.llvm.org/D24339 Files: clang-tidy/readability/CMakeLists.txt clang-tidy/readability/ReadabilityTidyModule.cpp

Re: [PATCH] D24339: [clang-tidy] Add check 'readability-redundant-member-init'

2016-09-22 Thread Malcolm Parsons via cfe-commits
malcolm.parsons updated this revision to Diff 72181. malcolm.parsons added a comment. Don't remove init of const members. Do remove calls to constructors that introduce cleanups. https://reviews.llvm.org/D24339 Files: clang-tidy/readability/CMakeLists.txt

Re: [PATCH] D24652: [clang-tidy] readability-avoid-const-params-in-decls template instantiation bugfix

2016-09-16 Thread Malcolm Parsons via cfe-commits
malcolm.parsons added inline comments. Comment at: clang-tidy/readability/AvoidConstParamsInDecls.cpp:41 @@ -40,1 +40,3 @@ + unless(cxxMethodDecl(ofClass(cxxRecordDecl(anyOf( + isLambda(), ast_matchers::isTemplateInstantiation()),

Re: [PATCH] D24339: [clang-tidy] Add check 'readability-redundant-member-init'

2016-09-16 Thread Malcolm Parsons via cfe-commits
malcolm.parsons updated this revision to Diff 71622. malcolm.parsons added a comment. Herald added a subscriber: mgorny. Handle unions and templated classes. Add FixItHints (depends on https://reviews.llvm.org/D24572). https://reviews.llvm.org/D24339 Files:

Re: [PATCH] D24848: [clang-tidy] fix false-positive for cppcoreguidelines-pro-type-member-init with in-class initializers

2016-09-28 Thread Malcolm Parsons via cfe-commits
malcolm.parsons added a comment. In https://reviews.llvm.org/D24848#555636, @mgehre wrote: > Are you okay with me committing this as it currently is? Yes. https://reviews.llvm.org/D24848 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

Re: [PATCH] D25024: [clang-tidy] Add check for detecting declarations with multiple names

2016-09-28 Thread Malcolm Parsons via cfe-commits
malcolm.parsons added a subscriber: malcolm.parsons. Comment at: clang-tidy/cppcoreguidelines/OneNamePerDeclarationCheck.cpp:30 @@ +29,3 @@ + Finder->addMatcher( + declStmt(declCountIsGreaterThan(1)).bind("multipleNameDeclaration"), + this); Can

Re: [PATCH] D22910: Add support for CXXOperatorCallExpr in Expr::HasSideEffects

2016-09-28 Thread Malcolm Parsons via cfe-commits
malcolm.parsons added a subscriber: malcolm.parsons. Comment at: lib/AST/Expr.cpp:2868 @@ +2867,3 @@ +// When looking for potential side-effects, we assume that these +// operators: assignment, increement and decrement are intended +// to have a side-effect and other

Re: [PATCH] D24886: Add [[clang::suppress(rule, ...)]] attribute

2016-09-27 Thread Malcolm Parsons via cfe-commits
malcolm.parsons added a subscriber: malcolm.parsons. malcolm.parsons added a comment. In https://reviews.llvm.org/D24886#554130, @mgehre wrote: > 2. Also, I suspect we will want this attribute to also be written on types I > was thinking about a case were that was useful, and didn't find any.

Re: [PATCH] D22725: [clang-tidy] Add check 'modernize-use-algorithm'

2016-09-28 Thread Malcolm Parsons via cfe-commits
malcolm.parsons added a subscriber: malcolm.parsons. malcolm.parsons added a comment. This check looks like it implements some of CppCoreGuidelines Bounds.4

[PATCH] D24965: [clang-tidy] Fix cppcoreguidelines-pro-type-member-init false negatives

2016-09-27 Thread Malcolm Parsons via cfe-commits
malcolm.parsons created this revision. malcolm.parsons added reviewers: alexfh, aaron.ballman, omtcyfz. malcolm.parsons added subscribers: cfe-commits, mgehre. Herald added a subscriber: nemanjai. Handle classes with default constructors that are defaulted or are not present in the AST. Classes

[PATCH] D25024: [clang-tidy] Add check for detecting declarations with multiple names

2016-10-03 Thread Malcolm Parsons via cfe-commits
malcolm.parsons added inline comments. > cppcoreguidelines-one-name-per-declaration.cpp:8 > + { > +int x = 42, y = 43; > +// CHECK-MESSAGES: :[[@LINE-1]]:5: warning: Do not declare multiple > names per declaration [cppcoreguidelines-one-name-per-declaration] The guideline says "Flag

[PATCH] D24339: [clang-tidy] Add check 'readability-redundant-member-init'

2016-10-03 Thread Malcolm Parsons via cfe-commits
malcolm.parsons updated this revision to Diff 73260. malcolm.parsons added a comment. Herald added a subscriber: modocache. Don't warn for trivially default constructable members https://reviews.llvm.org/D24339 Files: clang-tidy/readability/CMakeLists.txt

Re: [PATCH] D24848: [clang-tidy] fix false-positive for cppcoreguidelines-pro-type-member-init with in-class initializers

2016-09-26 Thread Malcolm Parsons via cfe-commits
malcolm.parsons added inline comments. Comment at: test/clang-tidy/cppcoreguidelines-pro-type-member-init.cpp:372 @@ +371,3 @@ + +struct Bug30487 +{ There's already this test: ``` struct NegativeInClassInitialized { int F = 0;

Re: [PATCH] D24652: [clang-tidy] readability-avoid-const-params-in-decls template instantiation bugfix

2016-09-26 Thread Malcolm Parsons via cfe-commits
malcolm.parsons updated this revision to Diff 72476. malcolm.parsons added a comment. Expand code comment https://reviews.llvm.org/D24652 Files: clang-tidy/readability/AvoidConstParamsInDecls.cpp test/clang-tidy/readability-avoid-const-params-in-decls.cpp Index:

Re: [PATCH] D24652: [clang-tidy] readability-avoid-const-params-in-decls template instantiation bugfix

2016-09-26 Thread Malcolm Parsons via cfe-commits
malcolm.parsons added inline comments. Comment at: clang-tidy/readability/AvoidConstParamsInDecls.cpp:39 @@ -38,2 +38,3 @@ // generate a non-definition FunctionDecl too. Ignore those. -

Re: [PATCH] D24444: [clang-tidy] modernize-use-default default constructor bugfix

2016-09-26 Thread Malcolm Parsons via cfe-commits
malcolm.parsons added a comment. ping https://reviews.llvm.org/D2 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Re: [PATCH] D24848: [clang-tidy] fix false-positive for cppcoreguidelines-pro-type-member-init with in-class initializers

2016-09-27 Thread Malcolm Parsons via cfe-commits
malcolm.parsons added a comment. In https://reviews.llvm.org/D24848#554145, @mgehre wrote: > Rename the struct that was introduced in the test. Note that I need to keep > the function Bug30487, > because that is where the false-positive warning was emitted. https://reviews.llvm.org/D24965

[PATCH] D25316: [clang-tidy] Enhance modernize-use-auto to casts

2016-10-10 Thread Malcolm Parsons via cfe-commits
malcolm.parsons marked 15 inline comments as done. malcolm.parsons added inline comments. Comment at: test/clang-tidy/modernize-use-auto-cast.cpp:14 + long l = 1; + int i1 = static_cast(l); + // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: use auto when initializing with a cast

[PATCH] D25316: [clang-tidy] Enhance modernize-use-auto to casts

2016-10-10 Thread Malcolm Parsons via cfe-commits
malcolm.parsons updated this revision to Diff 74163. malcolm.parsons added a comment. Really mention in release notes. https://reviews.llvm.org/D25316 Files: clang-tidy/modernize/UseAutoCheck.cpp clang-tidy/modernize/UseAutoCheck.h docs/ReleaseNotes.rst

[PATCH] D25316: [clang-tidy] Enhance modernize-use-auto to casts

2016-10-10 Thread Malcolm Parsons via cfe-commits
malcolm.parsons updated this revision to Diff 74162. malcolm.parsons added a comment. Use std::function https://reviews.llvm.org/D25316 Files: clang-tidy/modernize/UseAutoCheck.cpp clang-tidy/modernize/UseAutoCheck.h docs/clang-tidy/checks/modernize-use-auto.rst

[PATCH] D25992: [RecursiveASTVisitor] Visit the implicit expression of a CXXDefaultArgExpr

2016-10-26 Thread Malcolm Parsons via cfe-commits
malcolm.parsons created this revision. malcolm.parsons added reviewers: klimek, jdennett, alexfh. malcolm.parsons added a subscriber: cfe-commits. The matcher varDecl(hasDescendant( callExpr(hasDeclaration(functionDecl(unless(isNoThrow())) didn't match calls from default arguments because

[PATCH] D25925: [clang-tidy] Update cert-err58-cpp to match its new generalised form.

2016-10-27 Thread Malcolm Parsons via cfe-commits
malcolm.parsons updated this revision to Diff 75997. malcolm.parsons added a comment. Add tests for operator new with FIXME comment. https://reviews.llvm.org/D25925 Files: clang-tidy/cert/StaticObjectExceptionCheck.cpp docs/clang-tidy/checks/cert-err58-cpp.rst

[PATCH] D26118: [clang-tidy] Change readability-redundant-member-init to get base type from constructor

2016-10-29 Thread Malcolm Parsons via cfe-commits
malcolm.parsons created this revision. malcolm.parsons added reviewers: aaron.ballman, Eugene.Zelenko. malcolm.parsons added a subscriber: cfe-commits. Fixes PR30835 https://reviews.llvm.org/D26118 Files: clang-tidy/readability/RedundantMemberInitCheck.cpp Index:

[PATCH] D25925: [clang-tidy] Update cert-err58-cpp to match its new generalised form.

2016-10-29 Thread Malcolm Parsons via cfe-commits
malcolm.parsons updated this revision to Diff 76318. malcolm.parsons added a comment. Check calls to operator new. https://reviews.llvm.org/D25925 Files: clang-tidy/cert/StaticObjectExceptionCheck.cpp docs/clang-tidy/checks/cert-err58-cpp.rst

[PATCH] D26032: [ASTMatcher] Add operatorNew matcher for cxxNewExpr

2016-10-29 Thread Malcolm Parsons via cfe-commits
malcolm.parsons updated this revision to Diff 76316. malcolm.parsons added a comment. Extend hasDeclaration instead. https://reviews.llvm.org/D26032 Files: docs/LibASTMatchersReference.html include/clang/ASTMatchers/ASTMatchers.h include/clang/ASTMatchers/ASTMatchersInternal.h

[PATCH] D26119: [clang-tidy] Handle bitfields in cppcoreguidelines-pro-type-member-init

2016-10-29 Thread Malcolm Parsons via cfe-commits
malcolm.parsons created this revision. malcolm.parsons added reviewers: aaron.ballman, alexfh. malcolm.parsons added a subscriber: cfe-commits. Herald added a subscriber: nemanjai. Unnamed bitfields cannot be initialized. Bitfields cannot be in-class initialized. https://reviews.llvm.org/D26119

[PATCH] D25316: [clang-tidy] Enhance modernize-use-auto to casts

2016-10-29 Thread Malcolm Parsons via cfe-commits
malcolm.parsons added a comment. ping. https://reviews.llvm.org/D25316 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D25659: [clang-tidy] Avoid running aliased checks twice

2016-11-08 Thread Malcolm Parsons via cfe-commits
malcolm.parsons added a comment. In https://reviews.llvm.org/D25659#588658, @alexfh wrote: > I think, silently choosing one of the checks may be confusing and > counter-intuitive. Should we just warn in case we see the same check enabled > by multiple aliases? A warning is useful if the

Re: [clang-tools-extra] r286222 - [clang-tidy] clang-analyzer-alpha* checks are not registered, so there's no need to disable them

2016-11-08 Thread Malcolm Parsons via cfe-commits
On 8 November 2016 at 16:59, Alexander Kornienko wrote: > On Nov 8, 2016 2:11 AM, "Malcolm Parsons" wrote: >> Oh, I was using clang-analyzer-alpha.cplusplus.VirtualCall. >> >> Should clang-tidy have an option to enable experimental checks? > > I'd

[PATCH] D26118: [clang-tidy] Change readability-redundant-member-init to get base type from constructor

2016-11-08 Thread Malcolm Parsons via cfe-commits
malcolm.parsons added inline comments. Comment at: clang-tidy/readability/RedundantMemberInitCheck.cpp:57 "initializer for base class %0 is redundant") - << Init->getTypeSourceInfo()->getType() + << Construct->getType() <<

[PATCH] D26138: [clang-tidy] Add modernize-use-equals-delete check

2016-11-05 Thread Malcolm Parsons via cfe-commits
malcolm.parsons planned changes to this revision. malcolm.parsons added inline comments. Comment at: clang-tidy/modernize/UseEqualsDeleteCheck.cpp:58 + << FixItHint::CreateInsertion(StartLoc, "public: ") + << FixItHint::CreateInsertion(AfterLoc, " private:"); +}

[PATCH] D26453: [clang-tidy] Remove duplicated check from move-constructor-init

2016-11-09 Thread Malcolm Parsons via cfe-commits
malcolm.parsons created this revision. malcolm.parsons added reviewers: aaron.ballman, alexfh, flx. malcolm.parsons added a subscriber: cfe-commits. An addition to the move-constructor-init check was duplicating the modernize-pass-by-value check. Remove the additional check and UseCERTSemantics

[PATCH] D26453: [clang-tidy] Remove duplicated check from move-constructor-init

2016-11-09 Thread Malcolm Parsons via cfe-commits
malcolm.parsons updated this revision to Diff 77371. malcolm.parsons updated the summary for this revision. malcolm.parsons added a comment. Add ValuesOnly option to modernize-pass-by-value. https://reviews.llvm.org/D26453 Files: clang-tidy/cert/CERTTidyModule.cpp

[PATCH] D26453: [clang-tidy] Remove duplicated check from move-constructor-init

2016-11-09 Thread Malcolm Parsons via cfe-commits
malcolm.parsons added a comment. In https://reviews.llvm.org/D26453#590636, @flx wrote: > Is the modernize-pass-by-value check configurable in a way to only trigger > when copied constructor arguments are not moved? No; good idea. https://reviews.llvm.org/D26453

[PATCH] D26453: [clang-tidy] Remove duplicated check from move-constructor-init

2016-11-09 Thread Malcolm Parsons via cfe-commits
malcolm.parsons updated this revision to Diff 77358. malcolm.parsons added a comment. Update comment in performance-unnecessary-value-param check. https://reviews.llvm.org/D26453 Files: clang-tidy/cert/CERTTidyModule.cpp clang-tidy/misc/MoveConstructorInitCheck.cpp

[PATCH] D26418: [clang-tidy] Add '-suppress-checks-filter' option to suppress diagnostics from certain files

2016-11-09 Thread Malcolm Parsons via cfe-commits
malcolm.parsons resigned from this revision. malcolm.parsons removed a reviewer: malcolm.parsons. malcolm.parsons added a comment. In https://reviews.llvm.org/D26418#590476, @nkakuev wrote: > On a second thought, ignoring note locations might be a good enough solution > for me. > How should I

Re: [clang-tools-extra] r286222 - [clang-tidy] clang-analyzer-alpha* checks are not registered, so there's no need to disable them

2016-11-08 Thread Malcolm Parsons via cfe-commits
On 8 November 2016 at 08:28, Alexander Kornienko via cfe-commits wrote: > [clang-tidy] clang-analyzer-alpha* checks are not registered, so there's no > need to disable them Oh, I was using clang-analyzer-alpha.cplusplus.VirtualCall. Should clang-tidy have an option

[PATCH] D25659: [clang-tidy] Avoid running aliased checks twice

2016-11-08 Thread Malcolm Parsons via cfe-commits
malcolm.parsons added a comment. In https://reviews.llvm.org/D25659#588663, @alexfh wrote: > In https://reviews.llvm.org/D25659#588658, @alexfh wrote: > > > I think, silently choosing one of the checks may be confusing and > > counter-intuitive. Should we just warn in case we see the same check

[PATCH] D26511: [clang-tidy] Rename modernize-use-default to modernize-use-equals-default

2016-11-10 Thread Malcolm Parsons via cfe-commits
malcolm.parsons added a comment. In https://reviews.llvm.org/D26511#592665, @Prazek wrote: > It is introduced because of "modernize-use-delete" was too ambiguous because > of operator delete, so it was changed to "modernize-use-equals-delete". But > this case is not ambiguous at all, so I

[PATCH] D23130: [Clang-tidy] Add a check for definitions in the global namespace.

2016-11-10 Thread Malcolm Parsons via cfe-commits
malcolm.parsons added inline comments. Comment at: clang-tidy/google/GlobalNamesCheck.cpp:96 +// main() should be in the global namespace. +if (FDecl->isMain()) + return; Should `isMSVCRTEntryPoint()` be checked too?

[clang-tools-extra] r286472 - [clang-tidy] Add modernize-use-equals-delete check

2016-11-10 Thread Malcolm Parsons via cfe-commits
Author: malcolm.parsons Date: Thu Nov 10 10:46:59 2016 New Revision: 286472 URL: http://llvm.org/viewvc/llvm-project?rev=286472=rev Log: [clang-tidy] Add modernize-use-equals-delete check Summary: Fixes PR27872 Reviewers: klimek, hokein, alexfh, aaron.ballman Subscribers: Prazek,

[PATCH] D26138: [clang-tidy] Add modernize-use-equals-delete check

2016-11-10 Thread Malcolm Parsons via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL286472: [clang-tidy] Add modernize-use-equals-delete check (authored by malcolm.parsons). Changed prior to commit: https://reviews.llvm.org/D26138?vs=76971=77500#toc Repository: rL LLVM

[clang-tools-extra] r286466 - [clang-tidy] Add missing meta refresh for cert-msc30-c doc. NFC

2016-11-10 Thread Malcolm Parsons via cfe-commits
Author: malcolm.parsons Date: Thu Nov 10 10:19:17 2016 New Revision: 286466 URL: http://llvm.org/viewvc/llvm-project?rev=286466=rev Log: [clang-tidy] Add missing meta refresh for cert-msc30-c doc. NFC Modified: clang-tools-extra/trunk/docs/clang-tidy/checks/cert-msc30-c.rst Modified:

[PATCH] D26511: [clang-tidy] Rename modernize-use-default to modernize-use-equals-default

2016-11-10 Thread Malcolm Parsons via cfe-commits
malcolm.parsons created this revision. malcolm.parsons added reviewers: aaron.ballman, alexfh, angelgarcia. malcolm.parsons added a subscriber: cfe-commits. Herald added a subscriber: mgorny. https://reviews.llvm.org/D26511 Files: clang-tidy/modernize/CMakeLists.txt

[PATCH] D26511: [clang-tidy] Rename modernize-use-default to modernize-use-equals-default

2016-11-10 Thread Malcolm Parsons via cfe-commits
malcolm.parsons added inline comments. Comment at: clang-tidy/modernize/ModernizeTidyModule.cpp:58 "modernize-use-bool-literals"); -CheckFactories.registerCheck("modernize-use-default"); + CheckFactories.registerCheck("modernize-use-equals-default");

[PATCH] D26138: [clang-tidy] Add modernize-use-equals-delete check

2016-11-05 Thread Malcolm Parsons via cfe-commits
malcolm.parsons updated this revision to Diff 76971. malcolm.parsons added a comment. Check for non-public deleted methods. Remove imperfect FixItHint. Add FIXME comments. https://reviews.llvm.org/D26138 Files: clang-tidy/modernize/CMakeLists.txt

[PATCH] D25363: [Sema] Store a SourceRange for multi-token builtin types

2016-10-19 Thread Malcolm Parsons via cfe-commits
malcolm.parsons added inline comments. Comment at: include/clang/AST/TypeLoc.h:513 struct BuiltinLocInfo { - SourceLocation BuiltinLoc; + SourceRange BuiltinRange; }; aaron.ballman wrote: > malcolm.parsons wrote: > > aaron.ballman wrote: > > >

[PATCH] D25363: Store a SourceRange for multi-token builtin types

2016-10-18 Thread Malcolm Parsons via cfe-commits
malcolm.parsons added inline comments. Comment at: unittests/AST/SourceLocationTest.cpp:228 +} + TEST(CXXConstructorDecl, NoRetFunTypeLocRange) { aaron.ballman wrote: > Can you also add a test that the range is correct for something like `long > double` and

[PATCH] D25711: [Basic] unique_ptr-ify SourceManager::MacroArgsCacheMap (NFC)

2016-10-18 Thread Malcolm Parsons via cfe-commits
malcolm.parsons added inline comments. Comment at: cfe/trunk/lib/Basic/SourceManager.cpp:1941 +MacroArgsCache = llvm::make_unique(); +computeMacroArgsCache(*MacroArgsCache.get(), FID); + } Redundant .get() Repository: rL LLVM

[PATCH] D24572: [clang-tidy] Clean up code after applying replacements.

2016-10-18 Thread Malcolm Parsons via cfe-commits
malcolm.parsons added a comment. Does clang-apply-replacements need a similar change? Repository: rL LLVM https://reviews.llvm.org/D24572 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D25363: Store a SourceRange for multi-token builtin types

2016-10-18 Thread Malcolm Parsons via cfe-commits
malcolm.parsons added inline comments. Comment at: include/clang/AST/TypeLoc.h:513 struct BuiltinLocInfo { - SourceLocation BuiltinLoc; + SourceRange BuiltinRange; }; aaron.ballman wrote: > Since this doubles the size of the type loc for builtin types, do

[PATCH] D25363: Store a SourceRange for multi-token builtin types

2016-10-18 Thread Malcolm Parsons via cfe-commits
malcolm.parsons updated this revision to Diff 74975. malcolm.parsons added a comment. Add unit tests for long double. https://reviews.llvm.org/D25363 Files: include/clang/AST/TypeLoc.h include/clang/Sema/DeclSpec.h lib/Sema/DeclSpec.cpp lib/Sema/SemaType.cpp

[PATCH] D25769: [clang-tidy] Simplify modernize-use-default

2016-10-19 Thread Malcolm Parsons via cfe-commits
malcolm.parsons added inline comments. Comment at: test/clang-tidy/modernize-use-default-copy.cpp:85 + // CHECK-MESSAGES: :[[@LINE-2]]:3: warning: use '= default' + // CHECK-FIXES: /* don't delete */ = default; int Field; I don't know why cleanup removes

[PATCH] D25406: Fix doubled whitespace in modernize-use-auto fixit

2016-10-12 Thread Malcolm Parsons via cfe-commits
malcolm.parsons added inline comments. Comment at: clang-tidy/modernize/UseAutoCheck.cpp:378 + Lexer::getLocForEndOfToken(Range.getEnd(), 0, SM, Context->getLangOpts()); + bool Whitespace = isWhitespace(*FullSourceLoc(Next, SM).getCharacterData()); +

[PATCH] D25316: [clang-tidy] Enhance modernize-use-auto to casts

2016-10-10 Thread Malcolm Parsons via cfe-commits
malcolm.parsons updated this revision to Diff 74134. malcolm.parsons added a comment. Fix ast matcher Add test Fix parameter case Inline lambdas Doc fixes https://reviews.llvm.org/D25316 Files: clang-tidy/modernize/UseAutoCheck.cpp clang-tidy/modernize/UseAutoCheck.h

[PATCH] D25769: [clang-tidy] Simplify modernize-use-default

2016-10-20 Thread Malcolm Parsons via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL284735: [clang-tidy] Simplify modernize-use-default (authored by malcolm.parsons). Changed prior to commit: https://reviews.llvm.org/D25769?vs=75140=75307#toc Repository: rL LLVM

[clang-tools-extra] r284737 - Use auto in for loop

2016-10-20 Thread Malcolm Parsons via cfe-commits
Author: malcolm.parsons Date: Thu Oct 20 10:40:34 2016 New Revision: 284737 URL: http://llvm.org/viewvc/llvm-project?rev=284737=rev Log: Use auto in for loop Modified: clang-tools-extra/trunk/clang-tidy/modernize/UseDefaultCheck.cpp Modified:

[PATCH] D24339: [clang-tidy] Add check 'readability-redundant-member-init'

2016-10-20 Thread Malcolm Parsons via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL284742: [clang-tidy] Add check 'readability-redundant-member-init' (authored by malcolm.parsons). Changed prior to commit: https://reviews.llvm.org/D24339?vs=74769=75311#toc Repository: rL LLVM

[clang-tools-extra] r284742 - [clang-tidy] Add check 'readability-redundant-member-init'

2016-10-20 Thread Malcolm Parsons via cfe-commits
Author: malcolm.parsons Date: Thu Oct 20 11:08:03 2016 New Revision: 284742 URL: http://llvm.org/viewvc/llvm-project?rev=284742=rev Log: [clang-tidy] Add check 'readability-redundant-member-init' Summary: The check emits a warning if a member-initializer calls the member's default constructor

[PATCH] D25898: [clang-tidy] Enhance modernize-make-unique to handle unique_ptr.reset()

2016-10-22 Thread Malcolm Parsons via cfe-commits
malcolm.parsons created this revision. malcolm.parsons added reviewers: alexfh, aaron.ballman. malcolm.parsons added a subscriber: cfe-commits. Avoid naked new in unique_ptr.reset() by using make_unique Fixes http://llvm.org/PR27383 https://reviews.llvm.org/D25898 Files:

[PATCH] D25898: [clang-tidy] Enhance modernize-make-unique to handle unique_ptr.reset()

2016-10-23 Thread Malcolm Parsons via cfe-commits
malcolm.parsons added inline comments. Comment at: test/clang-tidy/modernize-make-shared.cpp:122 + Pderived = std::shared_ptr(new Derived()); + // CHECK-MESSAGES: :[[@LINE-1]]:14: warning: use std::make_shared instead + // CHECK-FIXES: Pderived = std::make_shared();

  1   2   3   4   >