Tokenizer: Added testcase that asserts that there are not internal errors when using typedefs. Ticket: #1887

This commit is contained in:
Daniel Marjamäki 2010-08-29 13:54:26 +02:00
parent edec43c913
commit 54e313efdc
1 changed files with 13 additions and 0 deletions

View File

@ -47,6 +47,7 @@ private:
TEST_CASE(tokenize6);
TEST_CASE(tokenize7);
TEST_CASE(tokenize8);
TEST_CASE(tokenize9);
// array access. replace "*(p+1)" => "p[1]"
TEST_CASE(tokenize6);
@ -396,6 +397,18 @@ private:
tokenizeDebugListing(code.c_str(), false));
}
void tokenize9()
{
errout.str("");
const char code[] = "typedef void (*fp)();\n"
"typedef fp (*fpp)();\n"
"void f() {\n"
" fpp x = (fpp)f();\n"
"}";
tokenizeAndStringify(code, false);
ASSERT_EQUALS("", errout.str());
}
void wrong_syntax()
{
{