AST: Handle L'x'

This commit is contained in:
Daniel Marjamäki 2013-11-20 05:57:56 +01:00
parent 47b98470eb
commit 6869d0de30
2 changed files with 5 additions and 0 deletions

View File

@ -413,6 +413,8 @@ static void compileTerm(Token *& tok, std::stack<Token*> &op)
{
if (!tok)
return;
if (Token::Match(tok, "L %str%|%char%"))
tok = tok->next();
if (tok->isLiteral()) {
op.push(tok);
tok = tok->next();

View File

@ -9991,6 +9991,9 @@ private:
testAst("char a[1]=\"\";"); // don't crash
testAst("int f(char argv[]);"); // don't crash
testAst("--"); // don't crash
ASSERT_EQUALS("'X''a'>", testAst("('X' > 'a')"));
ASSERT_EQUALS("'X''a'>", testAst("(L'X' > L'a')"));
}
void astpar() const { // parentheses