Fixed #1052 (Internal error for 'int vals[] = { 0x13, 1?0x01:0x00 };')
This commit is contained in:
parent
a5e43b4be5
commit
cd4e355f17
|
@ -2717,12 +2717,12 @@ bool Tokenizer::simplifyQuestionMark()
|
|||
break;
|
||||
}
|
||||
|
||||
else if (end->str() == "(")
|
||||
else if (Token::Match(end, "[({[]"))
|
||||
{
|
||||
++ind;
|
||||
}
|
||||
|
||||
else if (end->str() == ")")
|
||||
else if (Token::Match(end, "[)}]]"))
|
||||
{
|
||||
--ind;
|
||||
if (ind < 0)
|
||||
|
|
|
@ -1810,6 +1810,16 @@ private:
|
|||
"}\n";
|
||||
ASSERT_EQUALS("void f ( ) { bool x ; x = false ; int b ; b = 3 ; }", tok(code));
|
||||
}
|
||||
|
||||
{
|
||||
const char code[] = "int vals[] = { 0x13, 1?0x01:0x00 };";
|
||||
ASSERT_EQUALS("int * vals ; vals = { 19 , 1 } ;", tok(code));
|
||||
}
|
||||
|
||||
{
|
||||
const char code[] = "int vals[] = { 0x13, 0?0x01:0x00 };";
|
||||
ASSERT_EQUALS("int * vals ; vals = { 19 , 0 } ;", tok(code));
|
||||
}
|
||||
}
|
||||
|
||||
void calculations()
|
||||
|
|
Loading…
Reference in New Issue