Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: llvmorg-21-init, llvmorg-19.1.7, llvmorg-19.1.6, llvmorg-19.1.5, llvmorg-19.1.4, llvmorg-19.1.3, llvmorg-19.1.2, llvmorg-19.1.1, llvmorg-19.1.0
# 7deca859 16-Sep-2024 Congcong Cai <congcongcai0907@163.com>

[clang-tidy] fix false positive when member initialization depends on structured binging variable in cppcoreguidelines-prefer-member-initializer (#108743)

Fixes: #82970

Detecting dependiences wit

[clang-tidy] fix false positive when member initialization depends on structured binging variable in cppcoreguidelines-prefer-member-initializer (#108743)

Fixes: #82970

Detecting dependiences with `varDecl` is too strict. It will ignore the
`bingingDecl`.
This patch wants to use `valueDecl` to match more cases including
`bingingDecl`.

show more ...


# 33ceb2dd 06-Sep-2024 Kazu Hirata <kazu@google.com>

[clang-tidy] Avoid repeated hash lookups (NFC) (#107490)


Revision tags: llvmorg-19.1.0-rc4, llvmorg-19.1.0-rc3, llvmorg-19.1.0-rc2, llvmorg-19.1.0-rc1, llvmorg-20-init, llvmorg-18.1.8, llvmorg-18.1.7, llvmorg-18.1.6, llvmorg-18.1.5, llvmorg-18.1.4, llvmorg-18.1.3, llvmorg-18.1.2, llvmorg-18.1.1, llvmorg-18.1.0, llvmorg-18.1.0-rc4, llvmorg-18.1.0-rc3
# e9cec392 16-Feb-2024 Congcong Cai <congcongcai0907@163.com>

[clang-tidy] fix incorrect hint for InitListExpr in prefer-member-initializer (#81560)


Revision tags: llvmorg-18.1.0-rc2
# 6f32d6a4 01-Feb-2024 Carlos Galvez <carlosgalvezp@gmail.com>

[clang-tidy] Remove enforcement of rule C.48 from cppcoreguidelines-prefer-member-init (#80330)

This functionality already exists in
cppcoreguidelines-use-default-member-init. It was deprecated fro

[clang-tidy] Remove enforcement of rule C.48 from cppcoreguidelines-prefer-member-init (#80330)

This functionality already exists in
cppcoreguidelines-use-default-member-init. It was deprecated from this
check in clang-tidy 17.

This allows us to fully decouple this check from the corresponding
modernize check, which has an unhealthy dependency.

Fixes https://github.com/llvm/llvm-project/issues/62169

---------

Co-authored-by: Carlos Gálvez <carlos.galvez@zenseact.com>

show more ...


Revision tags: llvmorg-18.1.0-rc1, llvmorg-19-init
# 6a80e56a 22-Jan-2024 Piotr Zegar <me@piotrzegar.pl>

[clang-tidy] Fix macros handling in cppcoreguidelines-prefer-member-initializer (#72037)

Produces now valid fixes for a member variables initialized with macros.
Correctly uses expansion location i

[clang-tidy] Fix macros handling in cppcoreguidelines-prefer-member-initializer (#72037)

Produces now valid fixes for a member variables initialized with macros.
Correctly uses expansion location instead of location inside macro to
get init code.

Close #70189

show more ...


Revision tags: llvmorg-17.0.6, llvmorg-17.0.5
# 43e13fdc 02-Nov-2023 Congcong Cai <congcongcai0907@163.com>

[NFC][clang-tidy]refactor isAssignmentToMemberOf in PreferMemberInitializerCheck (#71006)


Revision tags: llvmorg-17.0.4
# 26374675 27-Oct-2023 Congcong Cai <congcongcai0907@163.com>

[clang-tidy]Fix PreferMemberInitializer false positive for reassignment (#70316)

- assignment twice cannot be simplified to once when assigning to
reference type
- safe assignment cannot be advanc

[clang-tidy]Fix PreferMemberInitializer false positive for reassignment (#70316)

- assignment twice cannot be simplified to once when assigning to
reference type
- safe assignment cannot be advanced before unsafe assignment

show more ...


# f5063bf7 26-Oct-2023 Congcong Cai <congcongcai0907@163.com>

[clang-tidy][NFC]refactor PreferMemberInitializerCheck for readability


Revision tags: llvmorg-17.0.3, llvmorg-17.0.2, llvmorg-17.0.1, llvmorg-17.0.0, llvmorg-17.0.0-rc4
# cbdc3e1b 27-Aug-2023 Piotr Zegar <me@piotrzegar.pl>

[clang-tidy][NFC] Fix cppcoreguidelines-init-variables findings

Fix issues found by clang-tidy in clang-tidy source directory.


Revision tags: llvmorg-17.0.0-rc3, llvmorg-17.0.0-rc2
# 7a4b12e3 07-Aug-2023 Piotr Zegar <me@piotrzegar.pl>

[clang-tidy] Exclude delegate constructors in cppcoreguidelines-prefer-member-initializer

As proposed by check fix would result in compilation error,
lets exclude delegate constructors from being ch

[clang-tidy] Exclude delegate constructors in cppcoreguidelines-prefer-member-initializer

As proposed by check fix would result in compilation error,
lets exclude delegate constructors from being checked.

Fixes: #52818

Reviewed By: ccotter

Differential Revision: https://reviews.llvm.org/D157242

show more ...


Revision tags: llvmorg-17.0.0-rc1, llvmorg-18-init, llvmorg-16.0.6, llvmorg-16.0.5, llvmorg-16.0.4, llvmorg-16.0.3, llvmorg-16.0.2
# b34ca085 16-Apr-2023 Piotr Zegar <me@piotrzegar.pl>

[clang-tidy] Fix handling of UseAssignment option in cppcoreguidelines-prefer-member-initializer

From now on check will use value from cppcoreguidelines-prefer-member-initializer
and fallback to mod

[clang-tidy] Fix handling of UseAssignment option in cppcoreguidelines-prefer-member-initializer

From now on check will use value from cppcoreguidelines-prefer-member-initializer
and fallback to modernize-use-default-member-init.UseAssignment if not specified.

Fixes: #55616.

Reviewed By: carlosgalvezp

Differential Revision: https://reviews.llvm.org/D147929

show more ...


Revision tags: llvmorg-16.0.1, llvmorg-16.0.0, llvmorg-16.0.0-rc4, llvmorg-16.0.0-rc3, llvmorg-16.0.0-rc2, llvmorg-16.0.0-rc1, llvmorg-17-init
# 7d2ea6c4 14-Jan-2023 Carlos Galvez <carlosgalvezp@gmail.com>

[clang-tidy][NFC] Use C++17 nested namespaces in the clang-tidy folder

Fix applied by running:

run-clang-tidy.py -checks=-*,modernize-concat-nested-namespaces

Differential Revision: https://review

[clang-tidy][NFC] Use C++17 nested namespaces in the clang-tidy folder

Fix applied by running:

run-clang-tidy.py -checks=-*,modernize-concat-nested-namespaces

Differential Revision: https://reviews.llvm.org/D141770

show more ...


Revision tags: llvmorg-15.0.7, llvmorg-15.0.6, llvmorg-15.0.5, llvmorg-15.0.4, llvmorg-15.0.3, working, llvmorg-15.0.2, llvmorg-15.0.1, llvmorg-15.0.0, llvmorg-15.0.0-rc3, llvmorg-15.0.0-rc2, llvmorg-15.0.0-rc1, llvmorg-16-init, llvmorg-14.0.6, llvmorg-14.0.5, llvmorg-14.0.4, llvmorg-14.0.3, llvmorg-14.0.2
# b859c39c 16-Apr-2022 Nathan James <n.james93@hotmail.co.uk>

[clang-tidy] Add a Standalone diagnostics mode to clang-tidy

Adds a flag to `ClangTidyContext` that is used to indicate to checks that fixes will only be applied one at a time.
This is to indicate t

[clang-tidy] Add a Standalone diagnostics mode to clang-tidy

Adds a flag to `ClangTidyContext` that is used to indicate to checks that fixes will only be applied one at a time.
This is to indicate to checks that each fix emitted should not depend on any other fixes emitted across the translation unit.
I've currently implemented the `IncludeInserter`, `LoopConvertCheck` and `PreferMemberInitializerCheck` to use these support these modes.

Reasoning behind this is in use cases like `clangd` it's only possible to apply one fix at a time.
For include inserter checks, the include is only added once for the first diagnostic that requires it, this will result in subsequent fixes not having the included needed.

A similar issue is seen in the `PreferMemberInitializerCheck` where the `:` will only be added for the first member that needs fixing.

Fixes emitted in `StandaloneDiagsMode` will likely result in malformed code if they are applied all together, conversely fixes currently emitted may result in malformed code if they are applied one at a time.
For this reason invoking `clang-tidy` from the binary will always with `StandaloneDiagsMode` disabled, However using it as a library its possible to select the mode you wish to use, `clangd` always selects `StandaloneDiagsMode`.

This is an example of the current behaviour failing
```lang=c++
struct Foo {
int A, B;
Foo(int D, int E) {
A = D;
B = E; // Fix Here
}
};
```
Incorrectly transformed to:
```lang=c++
struct Foo {
int A, B;
Foo(int D, int E), B(E) {
A = D;
// Fix Here
}
};
```
In `StandaloneDiagsMode`, it gets transformed to:
```lang=c++
struct Foo {
int A, B;
Foo(int D, int E) : B(E) {
A = D;
// Fix Here
}
};
```

Reviewed By: sammccall

Differential Revision: https://reviews.llvm.org/D97121

show more ...


Revision tags: llvmorg-14.0.1
# d0fcbb37 07-Apr-2022 Nathan James <n.james93@hotmail.co.uk>

[clang-tidy] Fix invalid fix-it for cppcoreguidelines-prefer-member-initializer

Fixes https://github.com/llvm/llvm-project/issues/53515.

Reviewed By: LegalizeAdulthood

Differential Revision: https

[clang-tidy] Fix invalid fix-it for cppcoreguidelines-prefer-member-initializer

Fixes https://github.com/llvm/llvm-project/issues/53515.

Reviewed By: LegalizeAdulthood

Differential Revision: https://reviews.llvm.org/D118927

show more ...


Revision tags: llvmorg-14.0.0, llvmorg-14.0.0-rc4, llvmorg-14.0.0-rc3, llvmorg-14.0.0-rc2, llvmorg-14.0.0-rc1, llvmorg-15-init, llvmorg-13.0.1, llvmorg-13.0.1-rc3, llvmorg-13.0.1-rc2, llvmorg-13.0.1-rc1, llvmorg-13.0.0, llvmorg-13.0.0-rc4, llvmorg-13.0.0-rc3
# dfc46f02 05-Sep-2021 Kazu Hirata <kazu@google.com>

[clang-tidy] Drop unnecessary const from return types (NFC)

Identified with readability-const-return-type.


Revision tags: llvmorg-13.0.0-rc2, llvmorg-13.0.0-rc1, llvmorg-14-init, llvmorg-12.0.1, llvmorg-12.0.1-rc4, llvmorg-12.0.1-rc3
# 86029e4c 24-Jun-2021 Martin Storsjö <martin@martin.st>

[clang-tools-extra] Rename StringRef _lower() method calls to _insensitive()


Revision tags: llvmorg-12.0.1-rc2, llvmorg-12.0.1-rc1, llvmorg-12.0.0, llvmorg-12.0.0-rc5, llvmorg-12.0.0-rc4, llvmorg-12.0.0-rc3, llvmorg-12.0.0-rc2
# a2e15fa5 22-Feb-2021 Nathan James <n.james93@hotmail.co.uk>

[clang-tidy] Harden PreferMemberInitializerCheck

Prevent warning when the values are initialized using fields that will be initialized later or VarDecls defined in the constructors body.
Both of the

[clang-tidy] Harden PreferMemberInitializerCheck

Prevent warning when the values are initialized using fields that will be initialized later or VarDecls defined in the constructors body.
Both of these cases can't be safely fixed.
Also improve logic of finding where to insert member initializers, previously it could be confused by in class member initializers.

Reviewed By: aaron.ballman

Differential Revision: https://reviews.llvm.org/D97132

show more ...


# 557d2ade 20-Feb-2021 Nathan James <n.james93@hotmail.co.uk>

[NFC] Refactor PreferMemberInitializerCheck


Revision tags: llvmorg-11.1.0, llvmorg-11.1.0-rc3, llvmorg-12.0.0-rc1, llvmorg-13-init, llvmorg-11.1.0-rc2, llvmorg-11.1.0-rc1, llvmorg-11.0.1, llvmorg-11.0.1-rc2
# 27553933 08-Dec-2020 Nathan James <n.james93@hotmail.co.uk>

[clang-tidy] Add support for diagnostics with no location

Add methods for emitting diagnostics with no location as well as a special diagnostic for configuration errors.
These show up in the errors

[clang-tidy] Add support for diagnostics with no location

Add methods for emitting diagnostics with no location as well as a special diagnostic for configuration errors.
These show up in the errors as [clang-tidy-config].
The reason to use a custom name rather than the check name is to distinguish the error isn't the same category as the check that reported it.

Reviewed By: aaron.ballman

Differential Revision: https://reviews.llvm.org/D91885

show more ...


Revision tags: llvmorg-11.0.1-rc1, llvmorg-11.0.0, llvmorg-11.0.0-rc6, llvmorg-11.0.0-rc5, llvmorg-11.0.0-rc4, llvmorg-11.0.0-rc3
# 4fc0214a 11-Sep-2020 Adam Balogh <adam.balogh@ericsson.com>

[clang-tidy] New check cppcoreguidelines-prefer-member-initializer

Finds member initializations in the constructor body which can be placed
into the initialization list instead. This does not only i

[clang-tidy] New check cppcoreguidelines-prefer-member-initializer

Finds member initializations in the constructor body which can be placed
into the initialization list instead. This does not only improves the
readability of the code but also affects positively its performance.
Class-member assignments inside a control statement or following the
first control statement are ignored.

Differential Revision: https://reviews.llvm.org/D71199

show more ...


Revision tags: llvmorg-11.0.0-rc2, llvmorg-11.0.0-rc1, llvmorg-12-init, llvmorg-10.0.1, llvmorg-10.0.1-rc4, llvmorg-10.0.1-rc3, llvmorg-10.0.1-rc2, llvmorg-10.0.1-rc1, llvmorg-10.0.0, llvmorg-10.0.0-rc6, llvmorg-10.0.0-rc5, llvmorg-10.0.0-rc4, llvmorg-10.0.0-rc3, llvmorg-10.0.0-rc2, llvmorg-10.0.0-rc1, llvmorg-11-init
# f5fd7486 12-Dec-2019 Adam Balogh <adam.balogh@ericsson.com>

[clang-tidy] New check readability-prefer-member-initializer

Finds member initializations in the constructor body which can
be placed to the member initializers of the constructor instead.
This does

[clang-tidy] New check readability-prefer-member-initializer

Finds member initializations in the constructor body which can
be placed to the member initializers of the constructor instead.
This does not only improves the readability of the code but also
affects positively its performance. Class-member assignments
inside a control statement or following the first control
statement are ignored.

Differential Revision: https://reviews.llvm.org/D71199

show more ...