[PATCH] D24892: [clang-tidy] Add option "LiteralInitializers" to cppcoreguidelines-pro-type-member-init

2019-05-23 Thread Matthias Gehre 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 rL361601: [clang-tidy] Add option LiteralInitializers to cppcoreguidelines-pro-type… (authored by mgehre, committed by ).

[PATCH] D24892: [clang-tidy] Add option "LiteralInitializers" to cppcoreguidelines-pro-type-member-init

2019-05-13 Thread Matthias Gehre via Phabricator via cfe-commits
mgehre updated this revision to Diff 199330. mgehre added a comment. Fix wrong merge of ReleaseNotes Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D24892/new/ https://reviews.llvm.org/D24892 Files:

[PATCH] D24892: [clang-tidy] Add option "LiteralInitializers" to cppcoreguidelines-pro-type-member-init

2019-05-13 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added inline comments. Comment at: clang-tools-extra/docs/ReleaseNotes.rst:66-69 +- Added `UseAssignment` option to `cppcoreguidelines-pro-type-member-init` + + If set to true, the check will provide fix-its with literal initializers + (``int i = 0;``) instead of

[PATCH] D24892: [clang-tidy] Add option "LiteralInitializers" to cppcoreguidelines-pro-type-member-init

2019-05-13 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. In D24892#1500371 , @mgehre wrote: > Do I wait for @alexfh to turn his red into a green, too? I think you covered all of the concerns he raised. If he doesn't give you an LG in the next 24 hours, I think you can go ahead

[PATCH] D24892: [clang-tidy] Add option "LiteralInitializers" to cppcoreguidelines-pro-type-member-init

2019-05-13 Thread Matthias Gehre via Phabricator via cfe-commits
mgehre added a comment. Do I wait for @alexfh to turn his red into a green, too? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D24892/new/ https://reviews.llvm.org/D24892 ___ cfe-commits mailing list

[PATCH] D24892: [clang-tidy] Add option "LiteralInitializers" to cppcoreguidelines-pro-type-member-init

2019-05-09 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman accepted this revision. aaron.ballman added a comment. LGTM Comment at: clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeMemberInitCheck.cpp:361 + case BuiltinType::Float: +return " = 0.0F"; + case BuiltinType::Double: We may not have

[PATCH] D24892: [clang-tidy] Add option "LiteralInitializers" to cppcoreguidelines-pro-type-member-init

2019-05-08 Thread Matthias Gehre via Phabricator via cfe-commits
mgehre updated this revision to Diff 198714. mgehre added a comment. Herald added a project: clang. Implement review comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D24892/new/ https://reviews.llvm.org/D24892 Files:

[PATCH] D24892: [clang-tidy] Add option "LiteralInitializers" to cppcoreguidelines-pro-type-member-init

2017-07-24 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh requested changes to this revision. alexfh added a comment. This revision now requires changes to proceed. A few more nits. Comment at: clang-tidy/cppcoreguidelines/ProTypeMemberInitCheck.h:68 bool IgnoreArrays; + // Whether fix-its for initializers of fundamental

[PATCH] D24892: [clang-tidy] Add option "LiteralInitializers" to cppcoreguidelines-pro-type-member-init

2017-07-20 Thread Matthias Gehre via Phabricator via cfe-commits
mgehre updated this revision to Diff 107632. mgehre marked 3 inline comments as done. mgehre added a comment. Herald added subscribers: kbarton, xazax.hun, JDevlieghere. Implemented all review comments Use global settings "UseAssignment" https://reviews.llvm.org/D24892 Files:

[PATCH] D24892: [clang-tidy] Add option "LiteralInitializers" to cppcoreguidelines-pro-type-member-init

2017-07-20 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh requested changes to this revision. alexfh added a comment. This revision now requires changes to proceed. In https://reviews.llvm.org/D24892#733016, @alexfh wrote: > In https://reviews.llvm.org/D24892#732243, @malcolm.parsons wrote: > > > In https://reviews.llvm.org/D24892#732217,

[PATCH] D24892: [clang-tidy] Add option "LiteralInitializers" to cppcoreguidelines-pro-type-member-init

2017-04-20 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added a comment. In https://reviews.llvm.org/D24892#732243, @malcolm.parsons wrote: > In https://reviews.llvm.org/D24892#732217, @alexfh wrote: > > > In https://reviews.llvm.org/D24892#723536, @malcolm.parsons wrote: > > > > > Is there any way for multiple checks to share an option? > > >

[PATCH] D24892: [clang-tidy] Add option "LiteralInitializers" to cppcoreguidelines-pro-type-member-init

2017-04-20 Thread Malcolm Parsons via Phabricator via cfe-commits
malcolm.parsons added a comment. In https://reviews.llvm.org/D24892#732217, @alexfh wrote: > In https://reviews.llvm.org/D24892#723536, @malcolm.parsons wrote: > > > Is there any way for multiple checks to share an option? > > > There's OptionsView::getLocalOrGlobal. See how StrictMode option is

[PATCH] D24892: [clang-tidy] Add option "LiteralInitializers" to cppcoreguidelines-pro-type-member-init

2017-04-20 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added a comment. In https://reviews.llvm.org/D24892#723536, @malcolm.parsons wrote: > The `modernize-use-default-member-init` check now has an option with the same > effect, but it is called `UseAssignment`. > We should use consistent option names. > Is there any way for multiple

[PATCH] D24892: [clang-tidy] Add option "LiteralInitializers" to cppcoreguidelines-pro-type-member-init

2017-04-11 Thread Malcolm Parsons via Phabricator via cfe-commits
malcolm.parsons added a comment. The `modernize-use-default-member-init` check now has an option with the same effect, but it is called `UseAssignment`. We should use consistent option names. Is there any way for multiple checks to share an option? https://reviews.llvm.org/D24892

[PATCH] D24892: [clang-tidy] Add option "LiteralInitializers" to cppcoreguidelines-pro-type-member-init

2017-04-03 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang-tidy/cppcoreguidelines/ProTypeMemberInitCheck.cpp:348 +static const char *getInitializer(QualType type, bool LiteralInitializers) { + const char *DefaultInitializer = "{}"; `type` doesn't follow our usual

[PATCH] D24892: [clang-tidy] Add option "LiteralInitializers" to cppcoreguidelines-pro-type-member-init

2017-03-30 Thread Matthias Gehre via Phabricator via cfe-commits
mgehre updated this revision to Diff 93511. mgehre added a comment. Put 'u' and 'l' on integer literals https://reviews.llvm.org/D24892 Files: clang-tidy/cppcoreguidelines/ProTypeMemberInitCheck.cpp clang-tidy/cppcoreguidelines/ProTypeMemberInitCheck.h docs/ReleaseNotes.rst

[PATCH] D24892: [clang-tidy] Add option "LiteralInitializers" to cppcoreguidelines-pro-type-member-init

2017-03-25 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang-tidy/cppcoreguidelines/ProTypeMemberInitCheck.cpp:377 +else if (type->isIntegerType()) + Initializer = " = 0"; +else if (type->isFloatingType()) mgehre wrote: > aaron.ballman wrote:

[PATCH] D24892: [clang-tidy] Add option "LiteralInitializers" to cppcoreguidelines-pro-type-member-init

2017-03-25 Thread Matthias Gehre via Phabricator via cfe-commits
mgehre added inline comments. Comment at: clang-tidy/cppcoreguidelines/ProTypeMemberInitCheck.cpp:377 +else if (type->isIntegerType()) + Initializer = " = 0"; +else if (type->isFloatingType()) aaron.ballman wrote: > What about cases

[PATCH] D24892: [clang-tidy] Add option "LiteralInitializers" to cppcoreguidelines-pro-type-member-init

2017-03-25 Thread Matthias Gehre via Phabricator via cfe-commits
mgehre updated this revision to Diff 93056. mgehre marked 2 inline comments as done. mgehre added a comment. Add suffix for floating point literals; clang-format https://reviews.llvm.org/D24892 Files: clang-tidy/cppcoreguidelines/ProTypeMemberInitCheck.cpp

[PATCH] D24892: [clang-tidy] Add option "LiteralInitializers" to cppcoreguidelines-pro-type-member-init

2016-10-11 Thread Haojian Wu via cfe-commits
hokein added inline comments. Comment at: test/clang-tidy/cppcoreguidelines-pro-type-member-init-literal-initializers.cpp:1 +// RUN: %check_clang_tidy %s cppcoreguidelines-pro-type-member-init %t -- -config="{CheckOptions: [{key:

Re: [PATCH] D24892: [clang-tidy] Add option "LiteralInitializers" to cppcoreguidelines-pro-type-member-init

2016-09-26 Thread Aaron Ballman via cfe-commits
aaron.ballman added inline comments. Comment at: clang-tidy/cppcoreguidelines/ProTypeMemberInitCheck.cpp:377 @@ +376,3 @@ +else if (type->isIntegerType()) + Initializer = " = 0"; +else if (type->isFloatingType()) What about cases where a

Re: [PATCH] D24892: [clang-tidy] Add option "LiteralInitializers" to cppcoreguidelines-pro-type-member-init

2016-09-24 Thread Matthias Gehre via cfe-commits
mgehre updated this revision to Diff 72394. mgehre added a comment. Extend test to negative case https://reviews.llvm.org/D24892 Files: clang-tidy/cppcoreguidelines/ProTypeMemberInitCheck.cpp clang-tidy/cppcoreguidelines/ProTypeMemberInitCheck.h

[PATCH] D24892: [clang-tidy] Add option "LiteralInitializers" to cppcoreguidelines-pro-type-member-init

2016-09-24 Thread Matthias Gehre via cfe-commits
mgehre created this revision. mgehre added reviewers: alexfh, aaron.ballman, hokein. mgehre added a subscriber: cfe-commits. Herald added a subscriber: nemanjai. Adds the option "LiteralInitializers" to cppcoreguidelines-pro-type-member-init. If set to non-zero, the check will provide fix-its