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

Piotr Zegar via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 21 07:17:02 PDT 2023


PiotrZSL created this revision.
PiotrZSL added reviewers: njames93, carlosgalvezp, isuckatcs, JonasToth, baloghadamsoftware.
Herald added a subscriber: xazax.hun.
Herald added a project: All.
PiotrZSL requested review of this revision.
Herald added a project: clang-tools-extra.
Herald added a subscriber: cfe-commits.

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: https://github.com/llvm/llvm-project/issues/40583

  https://github.com/llvm/llvm-project/issues/55143


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D153423

Files:
  clang-tools-extra/clang-tidy/bugprone/ExceptionEscapeCheck.cpp
  clang-tools-extra/docs/ReleaseNotes.rst
  clang-tools-extra/docs/clang-tidy/checks/bugprone/exception-escape.rst
  clang-tools-extra/test/clang-tidy/checkers/bugprone/exception-escape-coro.cpp
  clang-tools-extra/test/clang-tidy/checkers/bugprone/exception-escape.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D153423.533246.patch
Type: text/x-patch
Size: 8312 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230621/b42d35aa/attachment-0001.bin>


More information about the cfe-commits mailing list