1
0
Fork 0
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:
Mike Kucera 2009-11-16 02:27:59 +00:00
parent c60f642aa8
commit 760126e883

View file

@ -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