History log of /llvm-project/clang-tools-extra/clang-tidy/misc/UnusedUsingDeclsCheck.cpp (Results 1 – 25 of 43)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: llvmorg-21-init
# 8e6d6a55 24-Jan-2025 Congcong Cai <congcongcai0907@163.com>

[clang-tidy][NFC] improve performance misc-unused-using-decls (#123454)

skip header file before register AST Matchers
it can avoid to matcher lots of ast node when lint header file


# 68c6b2e1 22-Jan-2025 Congcong Cai <congcongcai0907@163.com>

[ASTMatchers][NFC] use `Matcher<QualType>` instead of `DynTypedMatcher` in `TypeLocTypeMatcher` (#123450)

There are no template in `TypeLocTypeMatcher`. So we do not need to use
`DynTypedMatcher` wh

[ASTMatchers][NFC] use `Matcher<QualType>` instead of `DynTypedMatcher` in `TypeLocTypeMatcher` (#123450)

There are no template in `TypeLocTypeMatcher`. So we do not need to use
`DynTypedMatcher` which can improve performance

show more ...


Revision tags: 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
# 282fc93f 30-Sep-2024 Congcong Cai <congcongcai0907@163.com>

[clang-tidy][NFC] optimize unused using decls performance (#110200)

Improve performance by moving the check forward to the matching stage


Revision tags: llvmorg-19.1.0, 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, llvmorg-18.1.0-rc2
# cc38cd85 02-Feb-2024 Carlos Galvez <carlosgalvezp@gmail.com>

[clang-tidy] Remove check-specific HeaderFileExtensions and Implement… (#80333)

…ationFileExtensions

Deprecated since clang-tidy 17. Use the corresponding global options
instead.

Fixes #61947

[clang-tidy] Remove check-specific HeaderFileExtensions and Implement… (#80333)

…ationFileExtensions

Deprecated since clang-tidy 17. Use the corresponding global options
instead.

Fixes #61947

---------

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

show more ...


Revision tags: llvmorg-18.1.0-rc1, llvmorg-19-init
# dca6f60b 16-Jan-2024 Congcong Cai <congcongcai0907@163.com>

[NFC][clang-tidy]improve performance for misc-unused-using-decls check (#78231)

`UnusedUsingDeclsCheck::removeFromFoundDecls` will be called with high
frequency. At current time it will check every

[NFC][clang-tidy]improve performance for misc-unused-using-decls check (#78231)

`UnusedUsingDeclsCheck::removeFromFoundDecls` will be called with high
frequency. At current time it will check every `Context`.
This patch adds a cache to reduce algorithm complexity.

show more ...


Revision tags: llvmorg-17.0.6, llvmorg-17.0.5, llvmorg-17.0.4
# 04ca1b6b 26-Oct-2023 Congcong Cai <congcongcai0907@163.com>

[clang-tidy]fix misc-unused-using-decls false positive false for using in elaborated type (#70230)

`ElaboratedType` including tag keywords and any nested-name-specifiers.
We should ignore nested-na

[clang-tidy]fix misc-unused-using-decls false positive false for using in elaborated type (#70230)

`ElaboratedType` including tag keywords and any nested-name-specifiers.
We should ignore nested-name-specifiers case but consider tag keywords
case for `misc-unused-using-decls` check
Fixes: #69714

show more ...


Revision tags: llvmorg-17.0.3, llvmorg-17.0.2, llvmorg-17.0.1, llvmorg-17.0.0
# 797cad9d 10-Sep-2023 Jan Svoboda <jan_svoboda@apple.com>

[clang] NFCI: Use `FileEntryRef` in 'clang-tools-extra'


Revision tags: llvmorg-17.0.0-rc4
# c2bee1ed 03-Sep-2023 Piotr Zegar <me@piotrzegar.pl>

[clang-tidy][NFC] Unwind if-else-if-... in UnusedUsingDeclsCheck

Break a if-else-if-else... chain. Use early return instead.

Fixes: #46375


Revision tags: llvmorg-17.0.0-rc3, llvmorg-17.0.0-rc2, 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, 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
# 5b37cddf 25-Jan-2023 Carlos Galvez <carlosgalvezp@gmail.com>

[clang-tidy] Introduce HeaderFileExtensions and ImplementationFileExtensions options

Re-introduce the patch that was reverted previously.
In the first attempt, the checks would not be able to
read f

[clang-tidy] Introduce HeaderFileExtensions and ImplementationFileExtensions options

Re-introduce the patch that was reverted previously.
In the first attempt, the checks would not be able to
read from the global option, since getLocalOrGlobal
only works with string types. Additional logic is needed
in order to support both use cases in the transition
period. All that logic will be removed when the local
options are fully removed.

We have a number of checks designed to analyze problems
in header files only, for example:

bugprone-suspicious-include
google-build-namespaces
llvm-header-guard
misc-definitions-in-header
...

All these checks duplicate the same logic and options
to determine whether a location is placed in the main
source file or in the header. More checks are coming
up with similar requirements.

Thus, to remove duplication, let's move this option
to the top-level configuration of clang-tidy (since
it's something all checks should share).

Add a deprecation notice for all checks that use the
local option, prompting to update to the global option.

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

show more ...


# 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
# 0e11d65a 02-Jan-2023 Haojian Wu <hokein.wu@gmail.com>

[clang-tidy] Don't emit misc-unused-using-decl warnings for header files.

Using decls in header files are special, usually as part of the
public API, the check should not emit warnings on these.

Th

[clang-tidy] Don't emit misc-unused-using-decl warnings for header files.

Using decls in header files are special, usually as part of the
public API, the check should not emit warnings on these.

The check already detects unused using-decls which are in the current main
file, but if the main file happens to be a header file, we still
emit warnings, this patch suppresses that.

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

show more ...


Revision tags: llvmorg-15.0.6
# 65272014 18-Nov-2022 Haojian Wu <hokein.wu@gmail.com>

[clang-tidy] Remove a duplicated if-branch in the unused-using-decl
check, NFC


# 8003c1d6 17-Nov-2022 v1nh1shungry <v1nh1shungry@outlook.com>

[clang-tidy] Fix misc-unused-using-decls for user-defined literals

Current version complains unused using-declaration even if the target
user-defined literal is used.

Reviewed By: ymandel

Differen

[clang-tidy] Fix misc-unused-using-decls for user-defined literals

Current version complains unused using-declaration even if the target
user-defined literal is used.

Reviewed By: ymandel

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

show more ...


Revision tags: 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
# 9add9495 11-May-2022 Whisperity <whisperity@gmail.com>

[ASTMatchers][clang-tidy][NFC] Hoist `forEachTemplateArgument` matcher into the core library

Fixes the `FIXME:` related to adding `forEachTemplateArgument` to the
core AST Matchers library.

Reviewe

[ASTMatchers][clang-tidy][NFC] Hoist `forEachTemplateArgument` matcher into the core library

Fixes the `FIXME:` related to adding `forEachTemplateArgument` to the
core AST Matchers library.

Reviewed By: aaron.ballman

Differential Revision: http://reviews.llvm.org/D125383

show more ...


Revision tags: llvmorg-14.0.3, llvmorg-14.0.2, llvmorg-14.0.1, 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
# af27466c 20-Dec-2021 Sam McCall <sam.mccall@gmail.com>

Reland "[AST] Add UsingType: a sugar type for types found via UsingDecl"

This reverts commit cc56c66f27e131b914082d3bd21180646e842e9a.
Fixed a bad assertion, the target of a UsingShadowDecl must not

Reland "[AST] Add UsingType: a sugar type for types found via UsingDecl"

This reverts commit cc56c66f27e131b914082d3bd21180646e842e9a.
Fixed a bad assertion, the target of a UsingShadowDecl must not have
*local* qualifiers, but it can be a typedef whose underlying type is qualified.

show more ...


# cc56c66f 20-Dec-2021 Sam McCall <sam.mccall@gmail.com>

Revert "[AST] Add UsingType: a sugar type for types found via UsingDecl"

This reverts commit e1600db19d6303f84b995acb9340459694e06ea9.

Breaks sanitizer tests, at least on windows:
https://lab.llvm.

Revert "[AST] Add UsingType: a sugar type for types found via UsingDecl"

This reverts commit e1600db19d6303f84b995acb9340459694e06ea9.

Breaks sanitizer tests, at least on windows:
https://lab.llvm.org/buildbot/#/builders/127/builds/21592/steps/4/logs/stdio

show more ...


Revision tags: llvmorg-13.0.1-rc1
# e1600db1 19-Nov-2021 Sam McCall <sam.mccall@gmail.com>

[AST] Add UsingType: a sugar type for types found via UsingDecl

Currently there's no way to find the UsingDecl that a typeloc found its
underlying type through. Compare to DeclRefExpr::getFoundDecl(

[AST] Add UsingType: a sugar type for types found via UsingDecl

Currently there's no way to find the UsingDecl that a typeloc found its
underlying type through. Compare to DeclRefExpr::getFoundDecl().

Design decisions:
- a sugar type, as there are many contexts this type of use may appear in
- UsingType is a leaf like TypedefType, the underlying type has no TypeLoc
- not unified with UnresolvedUsingType: a single name is appealing,
but being sometimes-sugar is often fiddly.
- not unified with TypedefType: the UsingShadowDecl is not a TypedefNameDecl or
even a TypeDecl, and users think of these differently.
- does not cover other rarer aliases like objc @compatibility_alias,
in order to be have a concrete API that's easy to understand.
- implicitly desugared by the hasDeclaration ASTMatcher, to avoid
breaking existing patterns and following the precedent of ElaboratedType.

Scope:
- This does not cover types associated with template names introduced by
using declarations. A future patch should introduce a sugar TemplateName
variant for this. (CTAD deduced types fall under this)
- There are enough AST matchers to fix the in-tree clang-tidy tests and
probably any other matchers, though more may be useful later.

Caveats:
- This changes a fairly common pattern in the AST people may depend on matching.
Previously, typeLoc(loc(recordType())) matched whether a struct was
referred to by its original scope or introduced via using-decl.
Now, the using-decl case is not matched, and needs a separate matcher.
This is similar to the case of typedefs but nevertheless both adds
complexity and breaks existing code.

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

show more ...


# 4db2e4ce 31-Oct-2021 Kazu Hirata <kazu@google.com>

Use {DenseSet,SetVector,SmallPtrSet}::contains (NFC)


Revision tags: llvmorg-13.0.0, llvmorg-13.0.0-rc4, llvmorg-13.0.0-rc3, 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, 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, llvmorg-11.1.0, llvmorg-11.1.0-rc3
# ab2d3ce4 28-Jan-2021 Alexander Kornienko <alexfh@google.com>

[clang-tidy] Applied clang-tidy fixes. NFC

Applied fixes enabled by the LLVM's .clang-tidy configs. Reverted files where
fixes introduced compile errors:
clang-tools-extra/clang-tidy/hicpp/NoAssem

[clang-tidy] Applied clang-tidy fixes. NFC

Applied fixes enabled by the LLVM's .clang-tidy configs. Reverted files where
fixes introduced compile errors:
clang-tools-extra/clang-tidy/hicpp/NoAssemblerCheck.cpp
clang-tools-extra/clang-tidy/misc/ThrowByValueCatchByReferenceCheck.cpp

$ clang-tools-extra/clang-tidy/tool/run-clang-tidy.py -fix clang-tools-extra/clang-tidy/
Enabled checks:
llvm-else-after-return
llvm-header-guard
llvm-include-order
llvm-namespace-comment
llvm-prefer-isa-or-dyn-cast-in-conditionals
llvm-prefer-register-over-unsigned
llvm-qualified-auto
llvm-twine-local
misc-definitions-in-headers
misc-misplaced-const
misc-new-delete-overloads
misc-no-recursion
misc-non-copyable-objects
misc-redundant-expression
misc-static-assert
misc-throw-by-value-catch-by-reference
misc-unconventional-assign-operator
misc-uniqueptr-reset-release
misc-unused-alias-decls
misc-unused-using-decls
readability-identifier-naming

Reviewed By: aaron.ballman

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

show more ...


Revision tags: 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, 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, 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
# 7d4c23b3 03-Feb-2020 Haojian Wu <hokein.wu@gmail.com>

[clang-tidy] Fix a false positive about C++17 deduced class template types in unused-using-decl check.

Reviewers: gribozavr2

Subscribers: xazax.hun, cfe-commits

Tags: #clang

Differential Revision

[clang-tidy] Fix a false positive about C++17 deduced class template types in unused-using-decl check.

Reviewers: gribozavr2

Subscribers: xazax.hun, cfe-commits

Tags: #clang

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

show more ...


Revision tags: llvmorg-10.0.0-rc1, llvmorg-11-init, llvmorg-9.0.1, llvmorg-9.0.1-rc3, llvmorg-9.0.1-rc2, llvmorg-9.0.1-rc1, llvmorg-9.0.0, llvmorg-9.0.0-rc6, llvmorg-9.0.0-rc5, llvmorg-9.0.0-rc4
# 67853ac4 03-Sep-2019 Haojian Wu <hokein@google.com>

[clang-tidy] Fix a false positive in unused-using-decl check

The previous matcher "hasAnyTemplateArgument(templateArgument())" only
matches the first template argument, but the check wants to iterat

[clang-tidy] Fix a false positive in unused-using-decl check

The previous matcher "hasAnyTemplateArgument(templateArgument())" only
matches the first template argument, but the check wants to iterate all
template arguments. This patch fixes this.

Also some refactorings in this patch (to make the code reusable).

llvm-svn: 370760

show more ...


Revision tags: llvmorg-9.0.0-rc3
# ccc272cd 23-Aug-2019 Benjamin Kramer <benny.kra@googlemail.com>

Fix clang-tidy warning in clang-tidy

argument name 'FixDescription' in comment does not match parameter name 'Description'

Patch by Nils Barth!

llvm-svn: 369783


Revision tags: llvmorg-9.0.0-rc2, llvmorg-9.0.0-rc1, llvmorg-10-init, llvmorg-8.0.1, llvmorg-8.0.1-rc4, llvmorg-8.0.1-rc3, llvmorg-8.0.1-rc2, llvmorg-8.0.1-rc1
# f2879d8a 17-Apr-2019 Haojian Wu <hokein@google.com>

[clang-tidy] Add fix descriptions to clang-tidy checks.

Summary:
Motivation/Context: in the code review system integrating with clang-tidy,
clang-tidy doesn't provide a human-readable description of

[clang-tidy] Add fix descriptions to clang-tidy checks.

Summary:
Motivation/Context: in the code review system integrating with clang-tidy,
clang-tidy doesn't provide a human-readable description of the fix. Usually
developers have to preview a code diff (before vs after apply the fix) to
understand what the fix does before applying a fix.

This patch proposes that each clang-tidy check provides a short and
actional fix description that can be shown in the UI, so that users can know
what the fix does without previewing diff.

This patch extends clang-tidy framework to support fix descriptions (will add implementations for
existing checks in the future). Fix descriptions and fixes are emitted via diagnostic::Note (rather than
attaching the main warning diagnostic).

Before this patch:

```
void MyCheck::check(...) {
...
diag(loc, "my check warning") << FixtItHint::CreateReplacement(...);
}
```

After:

```
void MyCheck::check(...) {
...
diag(loc, "my check warning"); // Emit a check warning
diag(loc, "fix description", DiagnosticIDs::Note) << FixtItHint::CreateReplacement(...); // Emit a diagnostic note and a fix
}
```

Reviewers: sammccall, alexfh

Reviewed By: alexfh

Subscribers: MyDeveloperDay, Eugene.Zelenko, aaron.ballman, JonasToth, xazax.hun, jdoerfert, cfe-commits

Tags: #clang-tools-extra, #clang

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

llvm-svn: 358576

show more ...


Revision tags: llvmorg-8.0.0, llvmorg-8.0.0-rc5, llvmorg-8.0.0-rc4, llvmorg-8.0.0-rc3, llvmorg-7.1.0, llvmorg-7.1.0-rc1, llvmorg-8.0.0-rc2, llvmorg-8.0.0-rc1
# 2946cd70 19-Jan-2019 Chandler Carruth <chandlerc@gmail.com>

Update the file headers across all of the LLVM projects in the monorepo
to reflect the new license.

We understand that people may be surprised that we're moving the header
entirely to discuss the ne

Update the file headers across all of the LLVM projects in the monorepo
to reflect the new license.

We understand that people may be surprised that we're moving the header
entirely to discuss the new license. We checked this carefully with the
Foundation's lawyer and we believe this is the correct approach.

Essentially, all code in the project is now made available by the LLVM
project under our new license, so you will see that the license headers
include that license only. Some of our contributors have contributed
code under our old license, and accordingly, we have retained a copy of
our old license notice in the top-level files in each project and
repository.

llvm-svn: 351636

show more ...


Revision tags: llvmorg-7.0.1, llvmorg-7.0.1-rc3, llvmorg-7.0.1-rc2, llvmorg-7.0.1-rc1, llvmorg-7.0.0, llvmorg-7.0.0-rc3, llvmorg-7.0.0-rc2
# c09197e0 09-Aug-2018 Stephen Kelly <steveire@gmail.com>

Port getLocEnd -> getEndLoc

Subscribers: nemanjai, ioeric, kbarton, cfe-commits

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

llvm-svn: 339401


12