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 816f687659d..f4358768c91 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 @@ -7459,7 +7459,7 @@ public class AST2Tests extends AST2TestBase { // a->x; // } public void testFunctionReturningFunctionPointer_413204() throws Exception { - parseAndCheckBindings(getAboveComment(), CPP); + parseAndCheckBindings(); } // double d = 00.9; diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CVisitor.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CVisitor.java index f0a49f4fce3..16b1839d170 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CVisitor.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CVisitor.java @@ -727,12 +727,9 @@ public class CVisitor extends ASTQueries { boolean isFunction= false; if (parent instanceof IASTParameterDeclaration || parent.getPropertyInParent() == ICASTKnRFunctionDeclarator.FUNCTION_PARAMETER) { IASTDeclarator fdtor = (IASTDeclarator) parent.getParent(); - if (ASTQueries.findTypeRelevantDeclarator(fdtor) instanceof IASTFunctionDeclarator) { - IASTDeclarator dtor = fdtor; - while (dtor.getNestedDeclarator() != null && !(dtor.getNestedDeclarator() instanceof IASTFunctionDeclarator)) { - dtor = dtor.getNestedDeclarator(); - } - IASTName n = dtor.getName(); + // Create parameter bindings only if the declarator declares a function + if (ASTQueries.findTypeRelevantDeclarator(fdtor) == fdtor) { + IASTName n = ASTQueries.findInnermostDeclarator(fdtor).getName(); IBinding temp = n.resolveBinding(); if (temp != null && temp instanceof CFunction) { binding = ((CFunction) temp).resolveParameter(name);