parent
7bf6b359b1
commit
13e12da08f
|
@ -8094,7 +8094,7 @@ void Tokenizer::findGarbageCode() const
|
|||
while (Token::Match(tok2, "*|&|&&"))
|
||||
tok2 = tok2->next();
|
||||
if (!Token::Match(tok2, "%name%"))
|
||||
syntaxError(tok2, "Unexpected token '" + tok2->str() + "'");
|
||||
syntaxError(tok2, "Unexpected token '" + (tok2 ? tok2->str() : "") + "'");
|
||||
}
|
||||
}
|
||||
if (Token::Match(tok, "enum : %num%| {"))
|
||||
|
|
|
@ -253,6 +253,7 @@ private:
|
|||
TEST_CASE(garbageCode220); // #6832
|
||||
TEST_CASE(garbageCode221);
|
||||
TEST_CASE(garbageCode222); // #10763
|
||||
TEST_CASE(garbageCode223); // #11639
|
||||
|
||||
TEST_CASE(garbageCodeFuzzerClientMode1); // test cases created with the fuzzer client, mode 1
|
||||
|
||||
|
@ -1716,6 +1717,9 @@ private:
|
|||
void garbageCode222() { // #10763
|
||||
ASSERT_THROW(checkCode("template<template<class>\n"), InternalError); // don't crash
|
||||
}
|
||||
void garbageCode223() { // #11639
|
||||
ASSERT_THROW(checkCode("struct{}*"), InternalError); // don't crash
|
||||
}
|
||||
|
||||
void syntaxErrorFirstToken() {
|
||||
ASSERT_THROW(checkCode("&operator(){[]};"), InternalError); // #7818
|
||||
|
|
Loading…
Reference in New Issue