Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: llvmorg-21-init, 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, 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
# 52dd4dbb 22-Jul-2024 Hana Dusíková <hanicka@hanicka.net>

[clang-tidy] `bugprone-exception-escape` didn't detech catching of an exception with pointer type by `void *` exception handler (#99773)

As in title, code which checks eligibility of exceptions with

[clang-tidy] `bugprone-exception-escape` didn't detech catching of an exception with pointer type by `void *` exception handler (#99773)

As in title, code which checks eligibility of exceptions with pointer
types to be handled by exception handler of type `void *` disallowed
this case. It was working like this:

```c++
if (isStandardPointerConvertible(ExceptionCanTy, HandlerCanTy) &&
isUnambiguousPublicBaseClass(
ExceptionCanTy->getTypePtr()->getPointeeType().getTypePtr(),
HandlerCanTy->getTypePtr()->getPointeeType().getTypePtr())) {
```

but in `isUnambiguousPublicBaseClass` there was code which looked for
definitions:

```c++
bool isUnambiguousPublicBaseClass(const Type *DerivedType,
const Type *BaseType) {
const auto *DerivedClass =
DerivedType->getCanonicalTypeUnqualified()->getAsCXXRecordDecl();
const auto *BaseClass =
BaseType->getCanonicalTypeUnqualified()->getAsCXXRecordDecl();
if (!DerivedClass || !BaseClass)
return false;
```

This code disallowed usage of `void *` type which was already correctly
detected in `isStandardPointerConvertible`.

AFAIK this seems like misinterpretation of specification:

> 14.4 Handling an exception
> a standard [pointer conversion](https://eel.is/c++draft/conv.ptr) not
involving conversions to pointers to private or protected or ambiguous
classes
(https://eel.is/c++draft/except.handle#3.3.1)

and

> 7.3.12 Pointer conversions
> ... If B is an inaccessible
([[class.access]](https://eel.is/c++draft/class.access)) or ambiguous
([[class.member.lookup]](https://eel.is/c++draft/class.member.lookup))
base class of D, a program that necessitates this conversion is
ill-formed[.](https://eel.is/c++draft/conv.ptr#3.sentence-2) ...
(https://eel.is/c++draft/conv.ptr#3)

14.4 is carving out private, protected, and ambiguous base classes, but
they are already carved out in 7.3.12 and implemented in
`isStandardPointerConvertible`

---------

Co-authored-by: Piotr Zegar <me@piotrzegar.pl>

show more ...


Revision tags: 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, llvmorg-18.1.0-rc1, llvmorg-19-init
# 356c2c23 14-Jan-2024 Da-Viper <57949090+Da-Viper@users.noreply.github.com>

Fix #75686: add iter_swap and iter_move to the matched name (#76117)

Added support for iter_swap, iter_move in bugprone-exception-escape
and performance-noexcept-swap checks.

Fixes #75686


Revision tags: llvmorg-17.0.6, llvmorg-17.0.5, llvmorg-17.0.4, llvmorg-17.0.3, llvmorg-17.0.2, llvmorg-17.0.1, llvmorg-17.0.0, llvmorg-17.0.0-rc4, llvmorg-17.0.0-rc3, llvmorg-17.0.0-rc2
# e8a3ddaf 07-Aug-2023 Nathan James <n.james93@hotmail.co.uk>

[clang-tidy][NFC] Update tests to specify CheckOptions using new syntax

In D128337, The spelling of CheckOptions was updated to support a more natural dictionary syntax.
This patch is just updating

[clang-tidy][NFC] Update tests to specify CheckOptions using new syntax

In D128337, The spelling of CheckOptions was updated to support a more natural dictionary syntax.
This patch is just updating all test files to use the new syntax.

Reviewed By: PiotrZSL

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

show more ...


Revision tags: llvmorg-17.0.0-rc1, llvmorg-18-init
# ff40c348 18-Jul-2023 Piotr Zegar <me@piotrzegar.pl>

[clang-tidy] Allow explicit throwing in bugprone-exception-escape for special functions

Functions declared explicitly with noexcept(false) or throw(exception)
will be excluded from the analysis, as

[clang-tidy] Allow explicit throwing in bugprone-exception-escape for special functions

Functions declared explicitly with noexcept(false) or throw(exception)
will be excluded from the analysis, as even though it is not recommended for
functions like swap, main, move constructors and assignment operators,
and destructors, it is a clear indication of the developer's intention and
should be respected.

Fixes: #40583, #55143

Reviewed By: carlosgalvezp

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

show more ...


# 27245077 17-Jul-2023 Piotr Zegar <me@piotrzegar.pl>

[clang-tidy] Model noexcept more properly in bugprone-exception-escape

During call stack analysis skip called noexcept functions
as they wont throw exceptions, they will crash.
Check will emit warni

[clang-tidy] Model noexcept more properly in bugprone-exception-escape

During call stack analysis skip called noexcept functions
as they wont throw exceptions, they will crash.
Check will emit warnings for those functions separately.

Fixes: #43667, #49151, #51596, #54668, #54956

Reviewed By: carlosgalvezp

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

show more ...


Revision tags: llvmorg-16.0.6, llvmorg-16.0.5, llvmorg-16.0.4
# 5545f1bb 07-May-2023 Piotr Zegar <me@piotrzegar.pl>

[clang-tidy][NFC] Split bugprone-exception-escape tests

Split tests files into noexcept and throw().
This is preparation for a C++20 support in this check.

Reviewed By: carlosgalvezp

Differential

[clang-tidy][NFC] Split bugprone-exception-escape tests

Split tests files into noexcept and throw().
This is preparation for a C++20 support in this check.

Reviewed By: carlosgalvezp

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

show more ...


Revision tags: llvmorg-16.0.3
# fc5f14c5 30-Apr-2023 Piotr Zegar <me@piotrzegar.pl>

[clang-tidy] Ignore declarations in bugprone-exception-escape

Warnings will now only be printed for function definitions, not declarations

Reviewed By: isuckatcs

Differential Revision: https://rev

[clang-tidy] Ignore declarations in bugprone-exception-escape

Warnings will now only be printed for function definitions, not declarations

Reviewed By: isuckatcs

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

show more ...


Revision tags: llvmorg-16.0.2, llvmorg-16.0.1, llvmorg-16.0.0, llvmorg-16.0.0-rc4, llvmorg-16.0.0-rc3
# b4d9ac8b 21-Feb-2023 Utkarsh Saxena <usx@google.com>

[C++20][ClangTidy] Update the ClangTidy tests to also test in C++20 mode

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


Revision tags: llvmorg-16.0.0-rc2, llvmorg-16.0.0-rc1, llvmorg-17-init, llvmorg-15.0.7, llvmorg-15.0.6, llvmorg-15.0.5, llvmorg-15.0.4, llvmorg-15.0.3
# 0303eafc 07-Oct-2022 isuckatcs <65320245+isuckatcs@users.noreply.github.com>

[clang-tidy] handle exceptions properly in `ExceptionAnalyzer`

This patch implements the exception handling rules found in
N4849 14.4 and as a result fixes many false positives in
the bugprone-excep

[clang-tidy] handle exceptions properly in `ExceptionAnalyzer`

This patch implements the exception handling rules found in
N4849 14.4 and as a result fixes many false positives in
the bugprone-exception-escape checker.

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

show more ...


# 8ae5e9ed 24-Feb-2023 David Spickett <david.spickett@linaro.org>

Revert "[clang-tidy] handle exceptions properly in `ExceptionAnalyzer`"

This reverts commit 6b0cf1e15f8f84e3d4b6f9522287f6460527a7bf.

The included test is timing out on Arm/AArch64 bots.


# 6b0cf1e1 07-Oct-2022 isuckatcs <65320245+isuckatcs@users.noreply.github.com>

[clang-tidy] handle exceptions properly in `ExceptionAnalyzer`

This patch implements the exception handling rules found in
N4849 14.4 and as a result fixes many false positives in
the bugprone-excep

[clang-tidy] handle exceptions properly in `ExceptionAnalyzer`

This patch implements the exception handling rules found in
N4849 14.4 and as a result fixes many false positives in
the bugprone-exception-escape checker.

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

show more ...


Revision tags: 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
# 89a1d03e 17-Jun-2022 Richard <legalize@xmission.com>

[clang-tidy] Organize test files into subdirectories by module (NFC)

Eliminate clutter by reorganizing the Lit test files for clang-tidy:
- Move checkers/<module>-* to checkers/<module>/*.
- Move mo

[clang-tidy] Organize test files into subdirectories by module (NFC)

Eliminate clutter by reorganizing the Lit test files for clang-tidy:
- Move checkers/<module>-* to checkers/<module>/*.
- Move module specific inputs from Inputs to <module>/Inputs. Remove
any module prefix from the file or subdirectory name as they are no
longer needed.
- Introduce a Lit substitution %clang_tidy_headers for the system
headers in checkers/Inputs/Headers and use this throughout. This
avoids referencing system headers through a relative path to the
parent directory and makes it clear that these fake system headers are
shared among all modules.
- Update add_new_check.py to follow the above conventions when creating
the boiler plate test files for a new check.
- Update Contributing.rst to describe per-module Inputs directory and
fix link to test source code.

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

show more ...