File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -59,6 +59,7 @@ class TestOther : public TestFixture {
59
59
TEST_CASE(zeroDiv19);
60
60
TEST_CASE(zeroDiv20); // #11175
61
61
TEST_CASE(zeroDiv21);
62
+ TEST_CASE(zeroDiv22);
62
63
63
64
TEST_CASE(zeroDivCond); // division by zero / useless condition
64
65
@@ -700,6 +701,14 @@ class TestOther : public TestFixture {
700
701
ASSERT_EQUALS("[test.cpp:2:14]: (error) Division by zero. [zerodiv]\n", errout_str());
701
702
}
702
703
704
+ void zeroDiv22()
705
+ {
706
+ check("int main() {\n"
707
+ " return _Generic((0), int: (42) / (0), default: 0);\n"
708
+ "}\n");
709
+ ASSERT_EQUALS("[test.cpp:2:36]: (error) Division by zero. [zerodiv]\n", errout_str());
710
+ }
711
+
703
712
void zeroDivCond() {
704
713
check("void f(unsigned int x) {\n"
705
714
" int y = 17 / x;\n"
You can’t perform that action at this time.
0 commit comments