Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions clang-tools-extra/clang-tidy/modernize/TypeTraitsCheck.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ static const llvm::StringSet<> ValueTraits = {
"is_array",
"is_assignable",
"is_base_of",
"is_bind_expression",
"is_bounded_array",
"is_class",
"is_compound",
Expand All @@ -40,10 +41,14 @@ static const llvm::StringSet<> ValueTraits = {
"is_destructible",
"is_empty",
"is_enum",
"is_error_code_enum",
"is_error_condition_enum",
"is_execution_policy",
"is_final",
"is_floating_point",
"is_function",
"is_fundamental",
"is_implicit_lifetime",
"is_integral",
"is_invocable",
"is_invocable_r",
Expand All @@ -65,14 +70,17 @@ static const llvm::StringSet<> ValueTraits = {
"is_nothrow_invocable_r",
"is_nothrow_move_assignable",
"is_nothrow_move_constructible",
"is_nothrow_relocatable",
"is_nothrow_swappable",
"is_nothrow_swappable_with",
"is_null_pointer",
"is_object",
"is_placeholder",
"is_pointer",
"is_pointer_interconvertible_base_of",
"is_polymorphic",
"is_reference",
"is_replaceable",
"is_rvalue_reference",
"is_same",
"is_scalar",
Expand All @@ -91,15 +99,26 @@ static const llvm::StringSet<> ValueTraits = {
"is_trivially_destructible",
"is_trivially_move_assignable",
"is_trivially_move_constructible",
"is_trivially_relocatable",
"is_unbounded_array",
"is_union",
"is_unsigned",
"is_virtual_base_of",
"is_void",
"is_volatile",
"negation",
"rank",
"ratio_equal",
"ratio_greater_equal",
"ratio_greater",
"ratio_less_equal",
"ratio_less",
"ratio_not_equal",
"reference_constructs_from_temporary",
"reference_converts_from_temporary",
"tuple_size",
"uses_allocator",
"variant_size",
};

static const llvm::StringSet<> TypeTraits = {
Expand Down Expand Up @@ -130,6 +149,12 @@ static const llvm::StringSet<> TypeTraits = {
"result_of",
"invoke_result",
"type_identity",
"tuple_element",
"variant_alternative",
"compare_three_way_result",
"common_comparison_category",
"unwrap_ref_decay",
"unwrap_reference",
};

static DeclarationName getName(const DependentScopeDeclRefExpr &D) {
Expand Down
3 changes: 3 additions & 0 deletions clang-tools-extra/docs/ReleaseNotes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,9 @@ Changes in existing checks
excluding variables with ``thread_local`` storage class specifier from being
matched.

- Improved :doc:`modernize-type-traits
<clang-tidy/checks/modernize/type-traits>` check by detecting more type traits.

- Improved :doc:`modernize-use-default-member-init
<clang-tidy/checks/modernize/use-default-member-init>` check by matching
arithmetic operations, ``constexpr`` and ``static`` values, and detecting
Expand Down