From 6869d0de301ceacbe06a17155f78fd44d023b6a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Wed, 20 Nov 2013 05:57:56 +0100 Subject: [PATCH] AST: Handle L'x' --- lib/tokenlist.cpp | 2 ++ test/testtokenize.cpp | 3 +++ 2 files changed, 5 insertions(+) diff --git a/lib/tokenlist.cpp b/lib/tokenlist.cpp index 7d90f90b2..c572fd2df 100644 --- a/lib/tokenlist.cpp +++ b/lib/tokenlist.cpp @@ -413,6 +413,8 @@ static void compileTerm(Token *& tok, std::stack &op) { if (!tok) return; + if (Token::Match(tok, "L %str%|%char%")) + tok = tok->next(); if (tok->isLiteral()) { op.push(tok); tok = tok->next(); diff --git a/test/testtokenize.cpp b/test/testtokenize.cpp index 3ff340586..98398c344 100644 --- a/test/testtokenize.cpp +++ b/test/testtokenize.cpp @@ -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