Skip to content

Latest commit

 

History

History
90 lines (61 loc) · 1.92 KB

modernize-use-noexcept.rst

File metadata and controls

90 lines (61 loc) · 1.92 KB

clang-tidy - modernize-use-noexcept

modernize-use-noexcept

This check replaces deprecated dynamic exception specifications with the appropriate noexcept specification (introduced in C++11). By default this check will replace throw() with noexcept, and throw(<exception>[,...]) or throw(...) with noexcept(false).

Example

transforms to:

Options

ReplacementString

Users can use ReplacementString to specify a macro to use instead of noexcept. This is useful when maintaining source code that uses custom exception specification marking other than noexcept. Fix-it hints will only be generated for non-throwing specifications.

Example

transforms to:

if the ReplacementString option is set to NOEXCEPT.

UseNoexceptFalse

Enabled by default, disabling will generate fix-it hints that remove throwing dynamic exception specs, e.g., throw(<something>), completely without providing a replacement text, except for destructors and delete operators that are noexcept(true) by default.

Example

transforms to:

if the UseNoexceptFalse option is set to 0.