1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-23 14:42:11 +02:00

Bug 413204 - "field could not be resolved" error in function returning

function pointer (really fixed this time)

Change-Id: Ica4255ca554db6952248fe1fae53d188a1b78d75
Signed-off-by: Nathan Ridge <zeratul976@hotmail.com>
Reviewed-on: https://git.eclipse.org/r/15840
Reviewed-by: Sergey Prigogin <eclipse.sprigogin@gmail.com>
IP-Clean: Sergey Prigogin <eclipse.sprigogin@gmail.com>
Tested-by: Sergey Prigogin <eclipse.sprigogin@gmail.com>
This commit is contained in:
Nathan Ridge 2013-08-26 02:01:28 -04:00 committed by Sergey Prigogin
parent 4fdb748881
commit 8a58b3aa23
2 changed files with 4 additions and 7 deletions

View file

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

View file

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