You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
description: "Microsoft C++ Code Analysis warning C26447 for the C++ Core Guidelines case F.6."
4
+
ms.date: 08/25/2020
4
5
ms.topic: reference
5
6
f1_keywords: ["C26447"]
6
7
helpviewer_keywords: ["C26447"]
7
8
---
8
9
# C26447 DONT_THROW_IN_NOEXCEPT
9
10
10
-
The function is declared **`noexcept`** but calls a function that may throw exceptions.
11
+
> The function is declared `noexcept` but calls function *function_name*that may throw exceptions (f.6).
11
12
12
-
C++ Core Guidelines:
13
+
C++ Core Guidelines:\
13
14
[F.6: If your function may not throw, declare it noexcept](https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#f6-if-your-function-may-not-throw-declare-it-noexcept).
14
15
15
-
This rule amends another rule, [C26440 DECLARE_NOEXCEPT](c26440.md), which tries to find functions that are good candidates to be marked as **`noexcept`**. In this case, the idea is that once some function is marked as **`noexcept`**, it must keep its contract by not invoking other code that may throw exceptions.
16
+
## Remarks
17
+
18
+
This rule amends another rule, [C26440 DECLARE_NOEXCEPT](c26440.md), which tries to find functions that are good candidates to mark as **`noexcept`**. In this case, the idea is that once you mark some function as **`noexcept`**, it must keep its contract by not invoking other code that may throw exceptions.
16
19
17
20
- The Microsoft C++ compiler already handles straightforward violations like **`throw`** statements in the function body (see [C4297](/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4297)).
18
-
- The rule focuses only on function calls. It flags targets that are not **`constexpr`** and that can potentially throw exceptions; in other words they are not marked explicitly as non-throwing by using **`noexcept`**, **`__declspec(nothrow)`**, **throw()**.
21
+
- The rule focuses only on function calls. It flags targets that aren't **`constexpr`** and that can potentially throw exceptions. In other words, they aren't marked explicitly as non-throwing by using **`noexcept`**, **`__declspec(nothrow)`**, or**throw()**.
19
22
- The compiler-generated target functions are skipped to reduce noise since exception specifications are not always provided by the compiler.
20
-
- The checker also skips special kinds of target functions that are expected to be implemented as **`noexcept`**; this rule is enforced by [C26439 SPECIAL_NOEXCEPT](c26439.md).
23
+
- The checker also skips special kinds of target functions we expect you to implement as **`noexcept`**; this rule is enforced by [C26439 SPECIAL_NOEXCEPT](c26439.md).
0 commit comments