aboutsummaryrefslogtreecommitdiff
path: root/clang-tools-extra/clang-tidy/modernize/UseConstraintsCheck.cpp
AgeCommit message (Collapse)AuthorFilesLines
2025-07-11[clang-tidy][NFC] add '.clang-tidy' config for clang-tidy project (#147793)Baranov Victor1-2/+2
Added `.clang-tidy` config as discussed in [RFC](https://discourse.llvm.org/t/rfc-create-hardened-clang-tidy-config-for-clang-tidy-directory/87247). Added `bugprone`, `readability`, `modernize`, `performance` checks that didn't create many warnings. Fixed minor warnings to make `/clang-tidy` directory complaint with `clang-tidy-20`. Disabled checks will be enabled in future PRs after fixing their warnings.
2025-06-10[clang-tidy][NFC] fix 'misc-use-internal-linkage' check warnings (#143482)Baranov Victor1-1/+1
Run misc-use-internal-linkage check over clang-tidy code. Also fixed a couple of other clang-tidy warnings. Apart from issues in header files, all '.cpp' in `clang-tools-extra/clang-tidy` must be clang-tidy clear now.
2025-04-16[clang] Fix elaborated keyword canonicalization (#135916)Matheus Izvekov1-2/+6
2025-04-01[clang] Concepts: support pack expansions for type constraints (#132626)Matheus Izvekov1-2/+2
This reverts an earlier attempt (adb0d8ddceb143749c519d14b8b31b481071da77 and 50e5411e4247421fd606f0a206682fcdf0303ae3) to support these expansions, which was limited to type arguments and which subverted the purpose of SubstTemplateTypeParmType. This propagates the ArgumentPackSubstitutionIndex along with the AssociatedConstraint, so that the pack expansion works, without needing any new transforms or otherwise any changes to the template instantiation process. This keeps the tests from the reverted commits, and adds a few more showing the new solution also works for NTTPs. Fixes https://github.com/llvm/llvm-project/issues/131798
2024-05-21[clang] NFCI: use TemplateArgumentLoc for type-param DefaultArgument (#92854)Matheus Izvekov1-3/+5
This is an enabler for a future patch. This allows an type-parameter default argument to be set as an arbitrary TemplateArgument, not just a type. This allows template parameter packs to have default arguments in the AST, even though the language proper doesn't support the syntax for it. This will be used in a later patch which synthesizes template parameter lists with arbitrary default arguments taken from template specializations. There are a few places we used SubsType, because we only had a type, now we use SubstTemplateArgument. SubstTemplateArgument was missing arguments for setting Instantiation location and entity names. Adding those is needed so we don't regress in diagnostics.
2024-05-15[clang-tidy] Fix crash in modernize-use-constraints (#92019)Piotr Zegar1-0/+4
Improved modernize-use-constraints check by fixing a crash that occurred in some scenarios and excluded system headers from analysis. Problem were with DependentNameTypeLoc having null type location as getQualifierLoc().getTypeLoc(). Fixes #91872
2024-05-15[clang-tidy][NFC] replace comparison of begin and end iterators with range ↵Julian Schmidt1-1/+1
empty (#91994) Improves readability by changing comparisons of `*_begin` and `*_end` iterators into `.empty()` on their range.
2023-10-31[clang][NFC] Refactor ElaboratedTypeKeywordVlad Serebrennikov1-2/+2
This patch moves ElaboratedTypeKeyword before `Type` definition so that the enum is complete where bit-field for it is declared. It also converts it to scoped enum and removes `ETK_` prefix.
2023-08-27[clang-tidy][NFC] Fix llvm-else-after-return findingsPiotr Zegar1-2/+3
Fix issues found by clang-tidy in clang-tidy source directory.
2023-08-27[clang-tidy][NFC] Fix modernize-return-braced-init-list findingsPiotr Zegar1-11/+9
Fix issues found by clang-tidy in clang-tidy source directory.
2023-08-27[clang-tidy][NFC] Fix readability-container-size-empty findingsPiotr Zegar1-2/+2
Fix issues found by clang-tidy in clang-tidy source directory.
2023-07-30[clang-tidy] Implement modernize-use-constraintsChris Cotter1-0/+488
Add new check to replace enable_if with C++20 constraints Reviewed By: PiotrZSL Differential Revision: https://reviews.llvm.org/D141892