Tokenizer: Added testcase that asserts that there are not internal errors when using typedefs. Ticket: #1887
This commit is contained in:
parent
edec43c913
commit
54e313efdc
|
@ -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()
|
||||
{
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue