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
reportError(tok, Severity::error, "throwInNoexceptFunction", "Exception thrown in function declared not to throw exceptions.", CWE398, Certainty::normal);
322
+
reportError(tok, Severity::error, "throwInNoexceptFunction", "Unhandled exception thrown in function declared not to throw exceptions.", CWE398, Certainty::normal);
Copy file name to clipboardExpand all lines: test/testexceptionsafety.cpp
+18-18Lines changed: 18 additions & 18 deletions
Original file line number
Diff line number
Diff line change
@@ -87,7 +87,7 @@ class TestExceptionSafety : public TestFixture {
87
87
" }\n"
88
88
"};");
89
89
ASSERT_EQUALS("[test.cpp:3:9]: (warning) Class x is not safe, destructor throws exception [exceptThrowInDestructor]\n"
90
-
"[test.cpp:3:9]: (error) Exception thrown in function declared not to throw exceptions. [throwInNoexceptFunction]\n", errout_str());
90
+
"[test.cpp:3:9]: (error) Unhandled exception thrown in function declared not to throw exceptions. [throwInNoexceptFunction]\n", errout_str());
91
91
92
92
check("class x {\n"
93
93
" ~x();\n"
@@ -96,7 +96,7 @@ class TestExceptionSafety : public TestFixture {
96
96
" throw e;\n"
97
97
"}");
98
98
ASSERT_EQUALS("[test.cpp:5:5]: (warning) Class x is not safe, destructor throws exception [exceptThrowInDestructor]\n"
99
-
"[test.cpp:5:5]: (error) Exception thrown in function declared not to throw exceptions. [throwInNoexceptFunction]\n", errout_str());
99
+
"[test.cpp:5:5]: (error) Unhandled exception thrown in function declared not to throw exceptions. [throwInNoexceptFunction]\n", errout_str());
100
100
101
101
// #3858 - throwing exception in try block in destructor.
102
102
check("class x {\n"
@@ -116,7 +116,7 @@ class TestExceptionSafety : public TestFixture {
116
116
" }\n"
117
117
" }\n"
118
118
"}");
119
-
ASSERT_EQUALS("[test.cpp:4:13]: (error) Exception thrown in function declared not to throw exceptions. [throwInNoexceptFunction]\n", errout_str());
119
+
ASSERT_EQUALS("[test.cpp:4:13]: (error) Unhandled exception thrown in function declared not to throw exceptions. [throwInNoexceptFunction]\n", errout_str());
120
120
121
121
// #11031 should not warn when noexcept false
122
122
check("class A {\n"
@@ -349,9 +349,9 @@ class TestExceptionSafety : public TestFixture {
349
349
"void func4() noexcept(false) { throw 1; }\n"
350
350
"void func5() noexcept(true) { func1(); }\n"
351
351
"void func6() noexcept(false) { func1(); }");
352
-
ASSERT_EQUALS("[test.cpp:2:25]: (error) Exception thrown in function declared not to throw exceptions. [throwInNoexceptFunction]\n"
353
-
"[test.cpp:3:31]: (error) Exception thrown in function declared not to throw exceptions. [throwInNoexceptFunction]\n"
354
-
"[test.cpp:5:31]: (error) Exception thrown in function declared not to throw exceptions. [throwInNoexceptFunction]\n", errout_str());
352
+
ASSERT_EQUALS("[test.cpp:2:25]: (error) Unhandled exception thrown in function declared not to throw exceptions. [throwInNoexceptFunction]\n"
353
+
"[test.cpp:3:31]: (error) Unhandled exception thrown in function declared not to throw exceptions. [throwInNoexceptFunction]\n"
354
+
"[test.cpp:5:31]: (error) Unhandled exception thrown in function declared not to throw exceptions. [throwInNoexceptFunction]\n", errout_str());
0 commit comments