Skip to content

Commit 7c1ca62

Browse files
committed
Merge remote-tracking branch 'origin/main' into users/ccc03-08-_clang-tidy_support_to_detect_conversion_in_make_optional_for_bugprone-optional-value-conversion_
2 parents d71fe1e + 976e413 commit 7c1ca62

File tree

41 files changed

+859
-282
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+859
-282
lines changed

clang-tools-extra/clang-tidy/misc/ConstCorrectnessCheck.cpp

+6-8
Original file line numberDiff line numberDiff line change
@@ -136,16 +136,14 @@ void ConstCorrectnessCheck::check(const MatchFinder::MatchResult &Result) {
136136
return;
137137

138138
VariableCategory VC = VariableCategory::Value;
139-
if (Variable->getType()->isReferenceType())
139+
const QualType VT = Variable->getType();
140+
if (VT->isReferenceType())
140141
VC = VariableCategory::Reference;
141-
if (Variable->getType()->isPointerType())
142+
else if (VT->isPointerType())
142143
VC = VariableCategory::Pointer;
143-
if (Variable->getType()->isArrayType()) {
144-
if (const auto *ArrayT = dyn_cast<ArrayType>(Variable->getType())) {
145-
if (ArrayT->getElementType()->isPointerType())
146-
VC = VariableCategory::Pointer;
147-
}
148-
}
144+
else if (const auto *ArrayT = dyn_cast<ArrayType>(VT))
145+
if (ArrayT->getElementType()->isPointerType())
146+
VC = VariableCategory::Pointer;
149147

150148
// Each variable can only be in one category: Value, Pointer, Reference.
151149
// Analysis can be controlled for every category.

clang/docs/LanguageExtensions.rst

+48-47
Original file line numberDiff line numberDiff line change
@@ -1604,53 +1604,54 @@ More information could be found `here <https://clang.llvm.org/docs/Modules.html>
16041604
Language Extensions Back-ported to Previous Standards
16051605
=====================================================
16061606

1607-
============================================ ================================ ============= =============
1608-
Feature Feature Test Macro Introduced In Backported To
1609-
============================================ ================================ ============= =============
1610-
variadic templates __cpp_variadic_templates C++11 C++03
1611-
Alias templates __cpp_alias_templates C++11 C++03
1612-
Non-static data member initializers __cpp_nsdmi C++11 C++03
1613-
Range-based ``for`` loop __cpp_range_based_for C++11 C++03
1614-
RValue references __cpp_rvalue_references C++11 C++03
1615-
Attributes __cpp_attributes C++11 C++03
1616-
Lambdas __cpp_lambdas C++11 C++03
1617-
Generalized lambda captures __cpp_init_captures C++14 C++03
1618-
Generic lambda expressions __cpp_generic_lambdas C++14 C++03
1619-
variable templates __cpp_variable_templates C++14 C++03
1620-
Binary literals __cpp_binary_literals C++14 C++03
1621-
Relaxed constexpr __cpp_constexpr C++14 C++11
1622-
Static assert with no message __cpp_static_assert >= 201411L C++17 C++11
1623-
Pack expansion in generalized lambda-capture __cpp_init_captures C++17 C++03
1624-
``if constexpr`` __cpp_if_constexpr C++17 C++11
1625-
fold expressions __cpp_fold_expressions C++17 C++03
1626-
Lambda capture of \*this by value __cpp_capture_star_this C++17 C++03
1627-
Attributes on enums __cpp_enumerator_attributes C++17 C++03
1628-
Guaranteed copy elision __cpp_guaranteed_copy_elision C++17 C++03
1629-
Hexadecimal floating literals __cpp_hex_float C++17 C++03
1630-
``inline`` variables __cpp_inline_variables C++17 C++03
1631-
Attributes on namespaces __cpp_namespace_attributes C++17 C++11
1632-
Structured bindings __cpp_structured_bindings C++17 C++03
1633-
template template arguments __cpp_template_template_args C++17 C++03
1634-
Familiar template syntax for generic lambdas __cpp_generic_lambdas C++20 C++03
1635-
``static operator[]`` __cpp_multidimensional_subscript C++20 C++03
1636-
Designated initializers __cpp_designated_initializers C++20 C++03
1637-
Conditional ``explicit`` __cpp_conditional_explicit C++20 C++03
1638-
``using enum`` __cpp_using_enum C++20 C++03
1639-
``if consteval`` __cpp_if_consteval C++23 C++20
1640-
``static operator()`` __cpp_static_call_operator C++23 C++03
1641-
Attributes on Lambda-Expressions C++23 C++11
1642-
Attributes on Structured Bindings __cpp_structured_bindings C++26 C++03
1643-
Packs in Structured Bindings __cpp_structured_bindings C++26 C++03
1644-
Static assert with user-generated message __cpp_static_assert >= 202306L C++26 C++11
1645-
Pack Indexing __cpp_pack_indexing C++26 C++03
1646-
``= delete ("should have a reason");`` __cpp_deleted_function C++26 C++03
1647-
Variadic Friends __cpp_variadic_friend C++26 C++03
1648-
-------------------------------------------- -------------------------------- ------------- -------------
1649-
Designated initializers (N494) C99 C89
1650-
Array & element qualification (N2607) C23 C89
1651-
Attributes (N2335) C23 C89
1652-
``#embed`` (N3017) C23 C89, C++
1653-
============================================ ================================ ============= =============
1607+
============================================= ================================ ============= =============
1608+
Feature Feature Test Macro Introduced In Backported To
1609+
============================================= ================================ ============= =============
1610+
variadic templates __cpp_variadic_templates C++11 C++03
1611+
Alias templates __cpp_alias_templates C++11 C++03
1612+
Non-static data member initializers __cpp_nsdmi C++11 C++03
1613+
Range-based ``for`` loop __cpp_range_based_for C++11 C++03
1614+
RValue references __cpp_rvalue_references C++11 C++03
1615+
Attributes __cpp_attributes C++11 C++03
1616+
Lambdas __cpp_lambdas C++11 C++03
1617+
Generalized lambda captures __cpp_init_captures C++14 C++03
1618+
Generic lambda expressions __cpp_generic_lambdas C++14 C++03
1619+
variable templates __cpp_variable_templates C++14 C++03
1620+
Binary literals __cpp_binary_literals C++14 C++03
1621+
Relaxed constexpr __cpp_constexpr C++14 C++11
1622+
Static assert with no message __cpp_static_assert >= 201411L C++17 C++11
1623+
Pack expansion in generalized lambda-capture __cpp_init_captures C++17 C++03
1624+
``if constexpr`` __cpp_if_constexpr C++17 C++11
1625+
fold expressions __cpp_fold_expressions C++17 C++03
1626+
Lambda capture of \*this by value __cpp_capture_star_this C++17 C++03
1627+
Attributes on enums __cpp_enumerator_attributes C++17 C++03
1628+
Guaranteed copy elision __cpp_guaranteed_copy_elision C++17 C++03
1629+
Hexadecimal floating literals __cpp_hex_float C++17 C++03
1630+
``inline`` variables __cpp_inline_variables C++17 C++03
1631+
Attributes on namespaces __cpp_namespace_attributes C++17 C++11
1632+
Structured bindings __cpp_structured_bindings C++17 C++03
1633+
template template arguments __cpp_template_template_args C++17 C++03
1634+
Familiar template syntax for generic lambdas __cpp_generic_lambdas C++20 C++03
1635+
``static operator[]`` __cpp_multidimensional_subscript C++20 C++03
1636+
Designated initializers __cpp_designated_initializers C++20 C++03
1637+
Conditional ``explicit`` __cpp_conditional_explicit C++20 C++03
1638+
``using enum`` __cpp_using_enum C++20 C++03
1639+
``if consteval`` __cpp_if_consteval C++23 C++20
1640+
``static operator()`` __cpp_static_call_operator C++23 C++03
1641+
Attributes on Lambda-Expressions C++23 C++11
1642+
Attributes on Structured Bindings __cpp_structured_bindings C++26 C++03
1643+
Packs in Structured Bindings __cpp_structured_bindings C++26 C++03
1644+
Structured binding declaration as a condition __cpp_structured_bindings C++26 C++98
1645+
Static assert with user-generated message __cpp_static_assert >= 202306L C++26 C++11
1646+
Pack Indexing __cpp_pack_indexing C++26 C++03
1647+
``= delete ("should have a reason");`` __cpp_deleted_function C++26 C++03
1648+
Variadic Friends __cpp_variadic_friend C++26 C++03
1649+
--------------------------------------------- -------------------------------- ------------- -------------
1650+
Designated initializers (N494) C99 C89
1651+
Array & element qualification (N2607) C23 C89
1652+
Attributes (N2335) C23 C89
1653+
``#embed`` (N3017) C23 C89, C++
1654+
============================================= ================================ ============= =============
16541655

16551656
Builtin type aliases
16561657
====================

0 commit comments

Comments
 (0)