diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2Tests.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2Tests.java index 5ff51636126..d13b7b906ce 100644 --- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2Tests.java +++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2Tests.java @@ -137,7 +137,7 @@ public class AST2Tests extends AST2BaseTest { } public void testBug75340() throws Exception { - IASTTranslationUnit tu = parseAndCheckBindings("void f(int i = 0, int * p = 0);"); //$NON-NLS-1$ + IASTTranslationUnit tu = parseAndCheckBindings("void f(int i = 0, int * p = 0);", ParserLanguage.CPP); //$NON-NLS-1$ IASTSimpleDeclaration sd = (IASTSimpleDeclaration) tu.getDeclarations()[0]; assertEquals(ASTSignatureUtil.getParameterSignature(sd.getDeclarators()[0]), "(int, int *)"); //$NON-NLS-1$ } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/GNUCSourceParser.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/GNUCSourceParser.java index f0d8dc8bbcd..736266308f6 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/GNUCSourceParser.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/GNUCSourceParser.java @@ -1775,7 +1775,7 @@ public class GNUCSourceParser extends AbstractGNUSourceCodeParser { try { fPreventKnrCheck++; declSpec= declSpecifierSeq(option); - declarator = initDeclarator(option); + declarator = declarator(option); } catch(FoundDeclaratorException fd) { declSpec= fd.declSpec; declarator= fd.declarator; @@ -1783,9 +1783,8 @@ public class GNUCSourceParser extends AbstractGNUSourceCodeParser { altDeclarator= fd.altDeclarator; backup(fd.currToken); } catch (FoundAggregateInitializer lie) { - if (declSpec == null) - declSpec= lie.fDeclSpec; - declarator= addInitializer(lie); + declSpec= lie.fDeclSpec; + declarator= lie.fDeclarator; } finally { fPreventKnrCheck--; }