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
|
||||
* ::= declaration_specifiers <openscope> declarator
|
||||
* <openscope> declaration_list compound_statement
|
||||
* ::= declaration_specifiers <openscope-ast> knr_function_declarator
|
||||
* <openscope-ast> declaration_list compound_statement
|
||||
*/
|
||||
public void consumeFunctionDefinitionKnR() {
|
||||
IASTCompoundStatement body = (IASTCompoundStatement) astStack.pop();
|
||||
|
@ -664,7 +664,7 @@ public class C99BuildASTParserAction extends BuildASTParserAction {
|
|||
ICASTKnRFunctionDeclarator decl = (ICASTKnRFunctionDeclarator) astStack.pop();
|
||||
astStack.closeScope();
|
||||
|
||||
ICASTSimpleDeclSpecifier declSpecifier = (ICASTSimpleDeclSpecifier) astStack.pop();
|
||||
ICASTDeclSpecifier declSpecifier = (ICASTDeclSpecifier) astStack.pop();
|
||||
decl.setParameterDeclarations(declarations);
|
||||
|
||||
// re-compute the length of the declaration to take the parameter declarations into account
|
||||
|
|
Loading…
Add table
Reference in a new issue