parent
3ec4da0f8a
commit
7f62d8ff98
|
@ -8059,7 +8059,7 @@ void Tokenizer::simplifyStructDecl()
|
|||
}
|
||||
|
||||
if (isEnum) {
|
||||
if (tok->next()->str() == "{") {
|
||||
if (tok->next()->str() == "{" && tok->next()->link() != tok->tokAt(2)) {
|
||||
tok->next()->str("(");
|
||||
tok->linkAt(1)->str(")");
|
||||
}
|
||||
|
|
|
@ -2583,11 +2583,18 @@ private:
|
|||
}
|
||||
|
||||
void simplifyVarDeclInitLists()
|
||||
{
|
||||
{
|
||||
const char code[] = "std::vector<int> v{a * b, 1};";
|
||||
const char exp[] = "std :: vector < int > v { a * b , 1 } ;";
|
||||
ASSERT_EQUALS(exp, tok(code));
|
||||
}
|
||||
{
|
||||
const char code[] = "enum E { E0 } e{};";
|
||||
const char exp[] = "enum E { E0 } ; enum E e ; e = { } ;";
|
||||
ASSERT_EQUALS(exp, tok(code));
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
REGISTER_TEST(TestSimplifyTokens)
|
||||
|
|
Loading…
Reference in New Issue