* Add test for #10011

* Format

* Format
This commit is contained in:
chrchr-github 2021-11-16 16:01:10 +01:00 committed by GitHub
parent 8bff45281d
commit 2998382c86
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 0 deletions

View File

@ -242,6 +242,7 @@ private:
TEST_CASE(garbageCode214); TEST_CASE(garbageCode214);
TEST_CASE(garbageCode215); // daca@home script with extension .c TEST_CASE(garbageCode215); // daca@home script with extension .c
TEST_CASE(garbageCode216); // #7884 TEST_CASE(garbageCode216); // #7884
TEST_CASE(garbageCode217); // #10011
TEST_CASE(garbageCodeFuzzerClientMode1); // test cases created with the fuzzer client, mode 1 TEST_CASE(garbageCodeFuzzerClientMode1); // test cases created with the fuzzer client, mode 1
@ -1673,6 +1674,14 @@ private:
"A<int> a;"); "A<int> a;");
} }
void garbageCode217() { // #10011
ASSERT_THROW(checkCode("void f() {\n"
" auto p;\n"
" if (g(p)) {}\n"
" assert();\n"
"}"), InternalError);
}
void syntaxErrorFirstToken() { void syntaxErrorFirstToken() {
ASSERT_THROW(checkCode("&operator(){[]};"), InternalError); // #7818 ASSERT_THROW(checkCode("&operator(){[]};"), InternalError); // #7818
ASSERT_THROW(checkCode("*(*const<> (size_t); foo) { } *(*const (size_t)() ; foo) { }"), InternalError); // #6858 ASSERT_THROW(checkCode("*(*const<> (size_t); foo) { } *(*const (size_t)() ; foo) { }"), InternalError); // #6858