mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-23 06:32:10 +02:00
Bug 295194 - [C99 Parser] class cast exception when parsing KnR syntax
This commit is contained in:
parent
c60f642aa8
commit
760126e883
1 changed files with 3 additions and 3 deletions
|
@ -652,8 +652,8 @@ public class C99BuildASTParserAction extends BuildASTParserAction {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* function_definition
|
* function_definition
|
||||||
* ::= declaration_specifiers <openscope> declarator
|
* ::= declaration_specifiers <openscope-ast> knr_function_declarator
|
||||||
* <openscope> declaration_list compound_statement
|
* <openscope-ast> declaration_list compound_statement
|
||||||
*/
|
*/
|
||||||
public void consumeFunctionDefinitionKnR() {
|
public void consumeFunctionDefinitionKnR() {
|
||||||
IASTCompoundStatement body = (IASTCompoundStatement) astStack.pop();
|
IASTCompoundStatement body = (IASTCompoundStatement) astStack.pop();
|
||||||
|
@ -664,7 +664,7 @@ public class C99BuildASTParserAction extends BuildASTParserAction {
|
||||||
ICASTKnRFunctionDeclarator decl = (ICASTKnRFunctionDeclarator) astStack.pop();
|
ICASTKnRFunctionDeclarator decl = (ICASTKnRFunctionDeclarator) astStack.pop();
|
||||||
astStack.closeScope();
|
astStack.closeScope();
|
||||||
|
|
||||||
ICASTSimpleDeclSpecifier declSpecifier = (ICASTSimpleDeclSpecifier) astStack.pop();
|
ICASTDeclSpecifier declSpecifier = (ICASTDeclSpecifier) astStack.pop();
|
||||||
decl.setParameterDeclarations(declarations);
|
decl.setParameterDeclarations(declarations);
|
||||||
|
|
||||||
// re-compute the length of the declaration to take the parameter declarations into account
|
// re-compute the length of the declaration to take the parameter declarations into account
|
||||||
|
|
Loading…
Add table
Reference in a new issue