From 2998382c864484f72182b6c91bf3820d92c48008 Mon Sep 17 00:00:00 2001 From: chrchr-github <78114321+chrchr-github@users.noreply.github.com> Date: Tue, 16 Nov 2021 16:01:10 +0100 Subject: [PATCH] Add test for #10011 (#3566) * Add test for #10011 * Format * Format --- test/testgarbage.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test/testgarbage.cpp b/test/testgarbage.cpp index fd75afa54..504643ac9 100644 --- a/test/testgarbage.cpp +++ b/test/testgarbage.cpp @@ -242,6 +242,7 @@ private: TEST_CASE(garbageCode214); TEST_CASE(garbageCode215); // daca@home script with extension .c TEST_CASE(garbageCode216); // #7884 + TEST_CASE(garbageCode217); // #10011 TEST_CASE(garbageCodeFuzzerClientMode1); // test cases created with the fuzzer client, mode 1 @@ -1673,6 +1674,14 @@ private: "A a;"); } + void garbageCode217() { // #10011 + ASSERT_THROW(checkCode("void f() {\n" + " auto p;\n" + " if (g(p)) {}\n" + " assert();\n" + "}"), InternalError); + } + void syntaxErrorFirstToken() { ASSERT_THROW(checkCode("&operator(){[]};"), InternalError); // #7818 ASSERT_THROW(checkCode("*(*const<> (size_t); foo) { } *(*const (size_t)() ; foo) { }"), InternalError); // #6858