mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-06 09:16:02 +02:00
Fix for 167833, failure to parse 'int32 f(int32 (*p));'
This commit is contained in:
parent
a415f36011
commit
65b9130f64
2 changed files with 5 additions and 9 deletions
|
@ -3795,17 +3795,9 @@ public class AST2Tests extends AST2BaseTest {
|
||||||
// int32 f(int32 (*p)) {
|
// int32 f(int32 (*p)) {
|
||||||
// return *p;
|
// return *p;
|
||||||
// }
|
// }
|
||||||
public void test167833_cpp() throws Exception {
|
public void test167833() throws Exception {
|
||||||
StringBuffer buffer = getContents(1)[0];
|
StringBuffer buffer = getContents(1)[0];
|
||||||
parseAndCheckBindings(buffer.toString(), ParserLanguage.CPP);
|
parseAndCheckBindings(buffer.toString(), ParserLanguage.CPP);
|
||||||
}
|
|
||||||
|
|
||||||
// typedef int int32;
|
|
||||||
// int32 f(int32 (*p)) {
|
|
||||||
// return *p;
|
|
||||||
// }
|
|
||||||
public void _test167833_c() throws Exception {
|
|
||||||
StringBuffer buffer = getContents(1)[0];
|
|
||||||
parseAndCheckBindings(buffer.toString(), ParserLanguage.C);
|
parseAndCheckBindings(buffer.toString(), ParserLanguage.C);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2349,6 +2349,10 @@ public class GNUCSourceParser extends AbstractGNUSourceCodeParser {
|
||||||
declSpec = fd.declSpec;
|
declSpec = fd.declSpec;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// bug 167833, no declspec no parameter.
|
||||||
|
if (current == LA(1))
|
||||||
|
throwBacktrack(current.getOffset(), current.getLength());
|
||||||
|
|
||||||
IASTDeclarator declarator = null;
|
IASTDeclarator declarator = null;
|
||||||
if (LT(1) != IToken.tSEMI)
|
if (LT(1) != IToken.tSEMI)
|
||||||
declarator = initDeclarator();
|
declarator = initDeclarator();
|
||||||
|
|
Loading…
Add table
Reference in a new issue