Skip to content

Commit 2998382

Browse files
Add test for #10011 (#3566)
* Add test for #10011 * Format * Format
1 parent 8bff452 commit 2998382

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

test/testgarbage.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,7 @@ class TestGarbage : public TestFixture {
242242
TEST_CASE(garbageCode214);
243243
TEST_CASE(garbageCode215); // daca@home script with extension .c
244244
TEST_CASE(garbageCode216); // #7884
245+
TEST_CASE(garbageCode217); // #10011
245246

246247
TEST_CASE(garbageCodeFuzzerClientMode1); // test cases created with the fuzzer client, mode 1
247248

@@ -1673,6 +1674,14 @@ class TestGarbage : public TestFixture {
16731674
"A<int> a;");
16741675
}
16751676

1677+
void garbageCode217() { // #10011
1678+
ASSERT_THROW(checkCode("void f() {\n"
1679+
" auto p;\n"
1680+
" if (g(p)) {}\n"
1681+
" assert();\n"
1682+
"}"), InternalError);
1683+
}
1684+
16761685
void syntaxErrorFirstToken() {
16771686
ASSERT_THROW(checkCode("&operator(){[]};"), InternalError); // #7818
16781687
ASSERT_THROW(checkCode("*(*const<> (size_t); foo) { } *(*const (size_t)() ; foo) { }"), InternalError); // #6858

0 commit comments

Comments
 (0)