diff --git a/test/testgarbage.cpp b/test/testgarbage.cpp index 86821973e..432919b17 100644 --- a/test/testgarbage.cpp +++ b/test/testgarbage.cpp @@ -235,6 +235,7 @@ private: TEST_CASE(garbageCode202); // #8907 TEST_CASE(garbageCode203); // #8972 TEST_CASE(garbageCode204); + TEST_CASE(garbageCode205); TEST_CASE(garbageCodeFuzzerClientMode1); // test cases created with the fuzzer client, mode 1 @@ -1598,6 +1599,25 @@ private: ASSERT_THROW(checkCode("template ()> c; template a as() {} as>();"), InternalError); } + void garbageCode205() { + checkCode("class CodeSnippetsEvent : public wxCommandEvent {\n" + "public :\n" + " CodeSnippetsEvent ( wxEventType commandType = wxEventType , int id = 0 ) ;\n" + " CodeSnippetsEvent ( const CodeSnippetsEvent & event ) ;\n" + "virtual wxEvent * Clone ( ) const { return new CodeSnippetsEvent ( * this ) ; }\n" + "private :\n" + " int m_SnippetID ;\n" + "} ;\n" + "const wxEventType wxEVT_CODESNIPPETS_GETFILELINKS = wxNewEventType ( )\n" + "CodeSnippetsEvent :: CodeSnippetsEvent ( wxEventType commandType , int id )\n" + ": wxCommandEvent ( commandType , id ) {\n" + "}\n" + "CodeSnippetsEvent :: CodeSnippetsEvent ( const CodeSnippetsEvent & Event )\n" + ": wxCommandEvent ( Event )\n" + ", m_SnippetID ( 0 ) {\n" + "}"); // don't crash + } + void syntaxErrorFirstToken() { ASSERT_THROW(checkCode("&operator(){[]};"), InternalError); // #7818 ASSERT_THROW(checkCode("*(*const<> (size_t); foo) { } *(*const (size_t)() ; foo) { }"), InternalError); // #6858