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::warning, "classPublicInterfaceDivZero", "Public interface of " + className + " is not safe. When calling " + s + ", if parameter " + varName + " is 0 that leads to division by zero.");
2484
+
reportError(tok, Severity::warning, "unsafeClassDivZero", "Public interface of " + className + " is not safe. When calling " + s + ", if parameter " + varName + " is 0 that leads to division by zero.");
ASSERT_EQUALS("[test.cpp:5]: (warning) Public interface of A is not safe. When calling A::dostuff(), if parameter x is 0 that leads to division by zero.\n", errout.str());
6521
6521
6522
-
checkPublicInterfaceDivZero("class A {\n"
6523
-
"public:\n"
6524
-
" void f1();\n"
6525
-
" void f2(int x);\n"
6526
-
"}\n"
6527
-
"void A::f1() {}\n"
6528
-
"void A::f2(int x) { int a = 1000 / x; }");
6522
+
checkUnsafeClassDivZero("class A {\n"
6523
+
"public:\n"
6524
+
" void f1();\n"
6525
+
" void f2(int x);\n"
6526
+
"}\n"
6527
+
"void A::f1() {}\n"
6528
+
"void A::f2(int x) { int a = 1000 / x; }");
6529
6529
ASSERT_EQUALS("[test.cpp:7]: (warning) Public interface of A is not safe. When calling A::f2(), if parameter x is 0 that leads to division by zero.\n", errout.str());
6530
6530
6531
-
checkPublicInterfaceDivZero("class A {\n"
6532
-
"public:\n"
6533
-
" void operator/(int x);\n"
6534
-
"}\n"
6535
-
"void A::operator/(int x) { int a = 1000 / x; }");
6531
+
checkUnsafeClassDivZero("class A {\n"
6532
+
"public:\n"
6533
+
" void operator/(int x);\n"
6534
+
"}\n"
6535
+
"void A::operator/(int x) { int a = 1000 / x; }");
0 commit comments