parent
ae8a3aae8d
commit
505b7f7ebd
|
@ -9164,7 +9164,7 @@ void Tokenizer::findGarbageCode() const
|
|||
syntaxError(tok);
|
||||
if (Token::Match(tok, "%cop%|= ]") && !(isCPP() && Token::Match(tok->previous(), "[|, &|= ]")))
|
||||
syntaxError(tok);
|
||||
if (Token::Match(tok, "[+-] [;,)]}]"))
|
||||
if (Token::Match(tok, "[+-] [;,)]}]") && !(isCPP() && Token::Match(tok->previous(), "operator [+-] ;")))
|
||||
syntaxError(tok);
|
||||
}
|
||||
|
||||
|
|
|
@ -397,6 +397,7 @@ private:
|
|||
TEST_CASE(simplifyOperatorName9); // ticket #5709 - comma operator not properly tokenized
|
||||
TEST_CASE(simplifyOperatorName10); // #8746 - using a::operator=
|
||||
TEST_CASE(simplifyOperatorName11); // #8889
|
||||
TEST_CASE(simplifyOperatorName12); // #9110
|
||||
|
||||
TEST_CASE(simplifyNullArray);
|
||||
|
||||
|
@ -6214,6 +6215,18 @@ private:
|
|||
ASSERT_EQUALS("template < typename T > void g ( S < & T :: template operator- < double > > ) { }", tokenizeAndStringify(code4));
|
||||
}
|
||||
|
||||
void simplifyOperatorName12() { // #9110
|
||||
const char code[] = "namespace a {"
|
||||
"template <typename b> void operator+(b);"
|
||||
"}"
|
||||
"using a::operator+;";
|
||||
ASSERT_EQUALS("namespace a { "
|
||||
"template < typename b > void operator+ ( b ) ; "
|
||||
"} "
|
||||
"using a :: operator+ ;",
|
||||
tokenizeAndStringify(code));
|
||||
}
|
||||
|
||||
void simplifyNullArray() {
|
||||
ASSERT_EQUALS("* ( foo . bar [ 5 ] ) = x ;", tokenizeAndStringify("0[foo.bar[5]] = x;"));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue