Skip to content

Commit dcd3e6b

Browse files
committed
Use ConstantExpr::getBinOpIdentity
Created using spr 1.3.5
2 parents 9803edb + 4bf82ae commit dcd3e6b

File tree

35 files changed

+4804
-1309
lines changed

35 files changed

+4804
-1309
lines changed

.ci/monolithic-linux.sh

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,6 @@ rm -rf "${BUILD_DIR}"
2323

2424
ccache --zero-stats
2525

26-
if [[ -n "${CLEAR_CACHE:-}" ]]; then
27-
echo "clearing cache"
28-
ccache --clear
29-
fi
30-
3126
mkdir -p artifacts/reproducers
3227

3328
# Make sure any clang reproducers will end up as artifacts.

.ci/monolithic-windows.sh

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,6 @@ BUILD_DIR="${BUILD_DIR:=${MONOREPO_ROOT}/build}"
2121

2222
rm -rf "${BUILD_DIR}"
2323

24-
if [[ -n "${CLEAR_CACHE:-}" ]]; then
25-
echo "clearing sccache"
26-
rm -rf "$SCCACHE_DIR"
27-
fi
28-
2924
sccache --zero-stats
3025
function at-exit {
3126
retcode=$?

clang-tools-extra/docs/ReleaseNotes.rst

Lines changed: 1 addition & 286 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,6 @@ Semantic Highlighting
5858
Compile flags
5959
^^^^^^^^^^^^^
6060

61-
- Added `BuiltinHeaders` config key which controls whether clangd's built-in
62-
headers are used or ones extracted from the driver.
63-
6461
Hover
6562
^^^^^
6663

@@ -93,301 +90,18 @@ Improvements to clang-query
9390
arguments. So when porting a query to C++, remove all instances of trailing
9491
comma (otherwise C++ compiler will just complain about "expected expression").
9592

96-
Improvements to include-cleaner
97-
-------------------------------
98-
- Deprecated the ``-insert`` and ``-remove`` command line options, and added
99-
the ``-disable-remove`` and ``-disable-insert`` command line options as
100-
replacements. The previous command line options were confusing because they
101-
did not imply the default state of the option (which is inserts and removes
102-
being enabled). The new options are easier to understand the semantics of.
103-
10493
Improvements to clang-tidy
10594
--------------------------
10695

107-
- Changed the :program:`check_clang_tidy.py` tool to use FileCheck's
108-
``--match-full-lines`` instead of ``strict-whitespace`` for ``CHECK-FIXES``
109-
clauses. Added a ``--match-partial-fixes`` option to keep previous behavior on
110-
specific tests. This may break tests for users with custom out-of-tree checks
111-
who use :program:`check_clang_tidy.py` as-is.
112-
113-
- Improved :program:`clang-tidy-diff.py` script. Add the `-warnings-as-errors`
114-
argument to treat warnings as errors.
115-
116-
- Improved :program:`clang-tidy` to show `CheckOptions` only for checks enabled
117-
in `Checks` when running ``--dump-config``.
118-
119-
- Fixed bug in :program:`clang-tidy` by which `HeaderFilterRegex` did not take
120-
effect when passed via the `.clang-tidy` file.
121-
122-
- Fixed bug in :program:`run_clang_tidy.py` where the program would not
123-
correctly display the checks enabled by the top-level `.clang-tidy` file.
124-
12596
New checks
12697
^^^^^^^^^^
12798

128-
- New :doc:`bugprone-capturing-this-in-member-variable
129-
<clang-tidy/checks/bugprone/capturing-this-in-member-variable>` check.
130-
131-
Finds lambda captures and ``bind`` function calls that capture the ``this``
132-
pointer and store it as class members without handle the copy and move
133-
constructors and the assignments.
134-
135-
- New :doc:`bugprone-misleading-setter-of-reference
136-
<clang-tidy/checks/bugprone/misleading-setter-of-reference>` check.
137-
138-
Finds setter-like member functions that take a pointer parameter and set a
139-
reference member of the same class with the pointed value.
140-
141-
- New :doc:`bugprone-unintended-char-ostream-output
142-
<clang-tidy/checks/bugprone/unintended-char-ostream-output>` check.
143-
144-
Finds unintended character output from ``unsigned char`` and ``signed char``
145-
to an ``ostream``.
146-
147-
- New :doc:`cppcoreguidelines-use-enum-class
148-
<clang-tidy/checks/cppcoreguidelines/use-enum-class>` check.
149-
150-
Finds unscoped (non-class) ``enum`` declarations and suggests using
151-
``enum class`` instead.
152-
153-
- New :doc:`llvm-prefer-static-over-anonymous-namespace
154-
<clang-tidy/checks/llvm/prefer-static-over-anonymous-namespace>` check.
155-
156-
Finds function and variable declarations inside anonymous namespace and
157-
suggests replacing them with ``static`` declarations.
158-
159-
- New :doc:`modernize-use-scoped-lock
160-
<clang-tidy/checks/modernize/use-scoped-lock>` check.
161-
162-
Finds uses of ``std::lock_guard`` and suggests replacing them with C++17's
163-
alternative ``std::scoped_lock``.
164-
165-
- New :doc:`portability-avoid-pragma-once
166-
<clang-tidy/checks/portability/avoid-pragma-once>` check.
167-
168-
Finds uses of ``#pragma once`` and suggests replacing them with standard
169-
include guards (``#ifndef``/``#define``/``#endif``) for improved portability.
170-
171-
- New :doc:`readability-ambiguous-smartptr-reset-call
172-
<clang-tidy/checks/readability/ambiguous-smartptr-reset-call>` check.
173-
174-
Finds potentially erroneous calls to ``reset`` method on smart pointers when
175-
the pointee type also has a ``reset`` method.
176-
177-
- New :doc:`readability-use-concise-preprocessor-directives
178-
<clang-tidy/checks/readability/use-concise-preprocessor-directives>` check.
179-
180-
Finds uses of ``#if`` that can be simplified to ``#ifdef`` or ``#ifndef`` and,
181-
since C23 and C++23, uses of ``#elif`` that can be simplified to ``#elifdef``
182-
or ``#elifndef``.
183-
18499
New check aliases
185100
^^^^^^^^^^^^^^^^^
186101

187102
Changes in existing checks
188103
^^^^^^^^^^^^^^^^^^^^^^^^^^
189104

190-
- Improved :doc:`bugprone-crtp-constructor-accessibility
191-
<clang-tidy/checks/bugprone/crtp-constructor-accessibility>` check by fixing
192-
false positives on deleted constructors that cannot be used to construct
193-
objects, even if they have public or protected access.
194-
195-
- Improved :doc:`bugprone-exception-escape
196-
<clang-tidy/checks/bugprone/exception-escape>` check to print stack trace
197-
of a potentially escaped exception.
198-
199-
- Added an option to :doc:`bugprone-multi-level-implicit-pointer-conversion
200-
<clang-tidy/checks/bugprone/multi-level-implicit-pointer-conversion>` to
201-
choose whether to enable the check in C code or not.
202-
203-
- Improved :doc:`bugprone-optional-value-conversion
204-
<clang-tidy/checks/bugprone/optional-value-conversion>` check to detect
205-
conversion in argument of ``std::make_optional``.
206-
207-
- Improved :doc:`bugprone-sizeof-expression
208-
<clang-tidy/checks/bugprone/sizeof-expression>` check by adding
209-
`WarnOnSizeOfInLoopTermination` option to detect misuses of ``sizeof``
210-
expression in loop conditions.
211-
212-
- Improved :doc:`bugprone-string-constructor
213-
<clang-tidy/checks/bugprone/string-constructor>` check to find suspicious
214-
calls of ``std::string`` constructor with char pointer, start position and
215-
length parameters.
216-
217-
- Improved :doc:`bugprone-unchecked-optional-access
218-
<clang-tidy/checks/bugprone/unchecked-optional-access>` fixing false
219-
positives from smart pointer accessors repeated in checking ``has_value``
220-
and accessing ``value``. The option `IgnoreSmartPointerDereference` should
221-
no longer be needed and will be removed. Also fixing false positive from
222-
const reference accessors to objects containing optional member.
223-
224-
- Improved :doc:`bugprone-unsafe-functions
225-
<clang-tidy/checks/bugprone/unsafe-functions>` check to allow specifying
226-
additional C++ member functions to match.
227-
228-
- Improved :doc:`cert-err33-c
229-
<clang-tidy/checks/cert/err33-c>` check by fixing false positives when
230-
a function name is just prefixed with a targeted function name.
231-
232-
- Improved :doc:`concurrency-mt-unsafe
233-
<clang-tidy/checks/concurrency/mt-unsafe>` check by fixing a false positive
234-
where ``strerror`` was flagged as MT-unsafe.
235-
236-
- Improved :doc:`cppcoreguidelines-avoid-goto
237-
<clang-tidy/checks/cppcoreguidelines/avoid-goto>` check by adding the option
238-
`IgnoreMacros` to ignore ``goto`` labels defined in macros.
239-
240-
- Improved :doc:`cppcoreguidelines-interfaces-global-init
241-
<clang-tidy/checks/cppcoreguidelines/interfaces-global-init>` check by
242-
fixing false positives on uses of ``constinit`` variables.
243-
244-
- Improved :doc:`cppcoreguidelines-missing-std-forward
245-
<clang-tidy/checks/cppcoreguidelines/missing-std-forward>` check by adding a
246-
flag to specify the function used for forwarding instead of ``std::forward``.
247-
248-
- Improved :doc:`cppcoreguidelines-pro-bounds-pointer-arithmetic
249-
<clang-tidy/checks/cppcoreguidelines/pro-bounds-pointer-arithmetic>` check by
250-
fixing false positives when calling indexing operators that do not perform
251-
pointer arithmetic in template, for example ``std::map::operator[]`` and
252-
when pointer arithmetic was used through type aliases.
253-
254-
- Improved :doc:`cppcoreguidelines-rvalue-reference-param-not-moved
255-
<clang-tidy/checks/cppcoreguidelines/rvalue-reference-param-not-moved>` check
256-
by adding a flag to specify the function used for moving instead of
257-
``std::move``.
258-
259-
- Improved :doc:`cppcoreguidelines-special-member-functions
260-
<clang-tidy/checks/cppcoreguidelines/special-member-functions>` check by
261-
adding the option `IgnoreMacros` to ignore classes defined in macros.
262-
263-
- Improved :doc:`google-readability-namespace-comments
264-
<clang-tidy/checks/google/readability-namespace-comments>` check by adding
265-
the option `AllowOmittingNamespaceComments` to accept if a namespace comment
266-
is omitted entirely.
267-
268-
- Improved :doc:`hicpp-avoid-goto
269-
<clang-tidy/checks/hicpp/avoid-goto>` check by adding the option
270-
`IgnoreMacros` to ignore ``goto`` labels defined in macros.
271-
272-
- Improved :doc:`hicpp-special-member-functions
273-
<clang-tidy/checks/hicpp/special-member-functions>` check by adding the
274-
option `IgnoreMacros` to ignore classes defined in macros.
275-
276-
- Improved :doc:`llvm-namespace-comment
277-
<clang-tidy/checks/llvm/namespace-comment>` check by adding the option
278-
`AllowOmittingNamespaceComments` to accept if a namespace comment is omitted
279-
entirely.
280-
281-
- Improved :doc:`misc-const-correctness
282-
<clang-tidy/checks/misc/const-correctness>` check by adding the option
283-
`AllowedTypes`, that excludes specified types from const-correctness
284-
checking and fixing false positives when modifying variant by ``operator[]``
285-
with template in parameters and supporting to check pointee mutation by
286-
`AnalyzePointers` option and fixing false positives when using const array
287-
type.
288-
289-
- Improved :doc:`misc-include-cleaner
290-
<clang-tidy/checks/misc/include-cleaner>` check by adding the options
291-
`UnusedIncludes` and `MissingIncludes`, which specify whether the check should
292-
report unused or missing includes respectively.
293-
294-
- Improved :doc:`misc-redundant-expression
295-
<clang-tidy/checks/misc/redundant-expression>` check by providing additional
296-
examples and fixing some macro related false positives.
297-
298-
- Improved :doc:`misc-unconventional-assign-operator
299-
<clang-tidy/checks/misc/unconventional-assign-operator>` check by fixing
300-
false positives when copy assignment operator function in a template class
301-
returns the result of another assignment to ``*this`` (``return *this=...``).
302-
303-
- Improved :doc:`misc-unused-using-decls
304-
<clang-tidy/checks/misc/unused-using-decls>` check by fixing false positives
305-
on ``operator""`` with template parameters.
306-
307-
- Improved :doc:`misc-use-internal-linkage
308-
<clang-tidy/checks/misc/use-internal-linkage>` check by fix false positives
309-
for function or variable in header file which contains macro expansion and
310-
excluding variables with ``thread_local`` storage class specifier from being
311-
matched.
312-
313-
- Improved :doc:`modernize-pass-by-value
314-
<clang-tidy/checks/modernize/pass-by-value>` check by fixing false positives
315-
when class passed by const-reference had a private move constructor.
316-
317-
- Improved :doc:`modernize-type-traits
318-
<clang-tidy/checks/modernize/type-traits>` check by detecting more type traits.
319-
320-
- Improved :doc:`modernize-use-default-member-init
321-
<clang-tidy/checks/modernize/use-default-member-init>` check by matching
322-
arithmetic operations, ``constexpr`` and ``static`` values, and detecting
323-
explicit casting of built-in types within member list initialization.
324-
325-
- Improved :doc:`modernize-use-designated-initializers
326-
<clang-tidy/checks/modernize/use-designated-initializers>` check by avoiding
327-
diagnosing designated initializers for ``std::array`` initializations.
328-
329-
- Improved :doc:`modernize-use-ranges
330-
<clang-tidy/checks/modernize/use-ranges>` check by updating suppress
331-
warnings logic for ``nullptr`` in ``std::find``.
332-
333-
- Improved :doc:`modernize-use-starts-ends-with
334-
<clang-tidy/checks/modernize/use-starts-ends-with>` check by adding more
335-
matched scenarios of ``find`` and ``rfind`` methods and fixing false
336-
positives when those methods were called with 3 arguments.
337-
338-
- Improved :doc:`modernize-use-std-numbers
339-
<clang-tidy/checks/modernize/use-std-numbers>` check to support math
340-
functions of different precisions.
341-
342-
- Improved :doc:`modernize-use-trailing-return-type
343-
<clang-tidy/checks/modernize/use-trailing-return-type>` check by adding
344-
support to modernize lambda signatures to use trailing return type and adding
345-
two new options: `TransformFunctions` and `TransformLambdas` to control
346-
whether function declarations and lambdas should be transformed by the check.
347-
Fixed false positives when lambda was matched as a function in C++11 mode.
348-
349-
- Improved :doc:`performance-move-const-arg
350-
<clang-tidy/checks/performance/move-const-arg>` check by fixing false
351-
negatives on ternary operators calling ``std::move``.
352-
353-
- Improved :doc:`performance-unnecessary-value-param
354-
<clang-tidy/checks/performance/unnecessary-value-param>` check performance by
355-
tolerating fix-it breaking compilation when functions is used as pointers
356-
to avoid matching usage of functions within the current compilation unit.
357-
Added an option `IgnoreCoroutines` with the default value `true` to
358-
suppress this check for coroutines where passing by reference may be unsafe.
359-
360-
- Improved :doc:`readability-convert-member-functions-to-static
361-
<clang-tidy/checks/readability/convert-member-functions-to-static>` check by
362-
fixing false positives on member functions with an explicit object parameter.
363-
364-
- Improved :doc:`readability-function-size
365-
<clang-tidy/checks/readability/function-size>` check by adding new option
366-
`CountMemberInitAsStmt` that allows counting class member initializers in
367-
constructors as statements.
368-
369-
- Improved :doc:`readability-math-missing-parentheses
370-
<clang-tidy/checks/readability/math-missing-parentheses>` check by fixing
371-
false negatives where math expressions are the operand of assignment operators
372-
or comparison operators.
373-
374-
- Improved :doc:`readability-named-parameter
375-
<clang-tidy/checks/readability/named-parameter>` check by adding the option
376-
`InsertPlainNamesInForwardDecls` to insert parameter names without comments
377-
for forward declarations only.
378-
379-
- Improved :doc:`readability-qualified-auto
380-
<clang-tidy/checks/readability/qualified-auto>` check by adding the option
381-
`AllowedTypes`, that excludes specified types from adding qualifiers.
382-
383-
- Improved :doc:`readability-redundant-inline-specifier
384-
<clang-tidy/checks/readability/redundant-inline-specifier>` check by fixing
385-
false positives on out-of-line explicitly defaulted functions.
386-
387-
- Improved :doc:`readability-redundant-smartptr-get
388-
<clang-tidy/checks/readability/redundant-smartptr-get>` check by fixing
389-
some false positives involving smart pointers to arrays.
390-
391105
Removed checks
392106
^^^^^^^^^^^^^^
393107

@@ -414,3 +128,4 @@ Improvements to pp-trace
414128

415129
Clang-tidy Visual Studio plugin
416130
-------------------------------
131+

clang/lib/Sema/AnalysisBasedWarnings.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -522,8 +522,7 @@ static bool areAllValuesNoReturn(const VarDecl *VD, const CFGBlock &VarBlk,
522522
}
523523

524524
// If all checked blocks satisfy the condition, the check is finished.
525-
if (std::all_of(BlocksToCheck.begin(), BlocksToCheck.end(),
526-
BlockSatisfiesCondition))
525+
if (llvm::all_of(BlocksToCheck, BlockSatisfiesCondition))
527526
return true;
528527

529528
// If this block does not contain the variable definition, check

clang/lib/Sema/SemaTemplateDeduction.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3083,8 +3083,7 @@ static TemplateDeductionResult ConvertDeducedTemplateArguments(
30833083

30843084
// If there was no default argument, deduction is incomplete.
30853085
if (DefArg.getArgument().isNull()) {
3086-
Info.Param = makeTemplateParameter(
3087-
const_cast<NamedDecl *>(TemplateParams->getParam(I)));
3086+
Info.Param = makeTemplateParameter(TemplateParams->getParam(I));
30883087
Info.reset(
30893088
TemplateArgumentList::CreateCopy(S.Context, CTAI.SugaredConverted),
30903089
TemplateArgumentList::CreateCopy(S.Context, CTAI.CanonicalConverted));
@@ -3100,8 +3099,7 @@ static TemplateDeductionResult ConvertDeducedTemplateArguments(
31003099
if (S.CheckTemplateArgument(
31013100
Param, DefArg, TD, TD->getLocation(), TD->getSourceRange().getEnd(),
31023101
/*ArgumentPackIndex=*/0, CTAI, Sema::CTAK_Specified)) {
3103-
Info.Param = makeTemplateParameter(
3104-
const_cast<NamedDecl *>(TemplateParams->getParam(I)));
3102+
Info.Param = makeTemplateParameter(TemplateParams->getParam(I));
31053103
// FIXME: These template arguments are temporary. Free them!
31063104
Info.reset(
31073105
TemplateArgumentList::CreateCopy(S.Context, CTAI.SugaredConverted),
@@ -3227,7 +3225,7 @@ static TemplateDeductionResult FinishTemplateArgumentDeduction(
32273225
if (ParamIdx >= TPL->size())
32283226
ParamIdx = TPL->size() - 1;
32293227

3230-
Decl *Param = const_cast<NamedDecl *>(TPL->getParam(ParamIdx));
3228+
Decl *Param = TPL->getParam(ParamIdx);
32313229
Info.Param = makeTemplateParameter(Param);
32323230
Info.FirstArg = Ps[ArgIdx].getArgument();
32333231
return TemplateDeductionResult::SubstitutionFailure;

lldb/test/API/python_api/type/main.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,12 @@ template <unsigned Value> struct PointerInfo {
4444
};
4545

4646
template <unsigned Value, typename InfoType = PointerInfo<Value>>
47-
struct Pointer {};
47+
struct Pointer {
48+
// When compiling for Windows with exceptions enabled, this struct
49+
// must contain something that takes space and is initialised.
50+
// Otherwise it will not be present in the debug information.
51+
int pad = 0;
52+
};
4853

4954
enum EnumType {};
5055
enum class ScopedEnumType {};

0 commit comments

Comments
 (0)