This commit is contained in:
parent
c73dc63537
commit
fc1d62fd45
|
@ -1504,7 +1504,7 @@ void Tokenizer::simplifyTypedef()
|
|||
if (!tok2->next())
|
||||
syntaxError(tok2); // can't recover so quit
|
||||
|
||||
if (!inCast && !inSizeof)
|
||||
if (!inCast && !inSizeof && !inTemplate)
|
||||
tok2 = tok2->next();
|
||||
|
||||
if (tok2->str() == "const")
|
||||
|
|
|
@ -160,6 +160,7 @@ private:
|
|||
TEST_CASE(simplifyTypedef120); // ticket #8357
|
||||
TEST_CASE(simplifyTypedef121); // ticket #5766
|
||||
TEST_CASE(simplifyTypedef122); // segmentation fault
|
||||
TEST_CASE(simplifyTypedef123); // ticket #7406
|
||||
|
||||
TEST_CASE(simplifyTypedefFunction1);
|
||||
TEST_CASE(simplifyTypedefFunction2); // ticket #1685
|
||||
|
@ -2499,6 +2500,15 @@ private:
|
|||
ASSERT_EQUALS("", errout.str());
|
||||
}
|
||||
|
||||
void simplifyTypedef123() { // ticket #7406
|
||||
const char code[] = "typedef int intvec[1];\n"
|
||||
"Dummy<intvec> y;";
|
||||
const char exp [] = "Dummy < int [ 1 ] > y ;";
|
||||
ASSERT_EQUALS(exp, tok(code, false));
|
||||
ASSERT_EQUALS("", errout.str());
|
||||
}
|
||||
|
||||
|
||||
void simplifyTypedefFunction1() {
|
||||
{
|
||||
const char code[] = "typedef void (*my_func)();\n"
|
||||
|
|
Loading…
Reference in New Issue