1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

Fix for 168054, name resolution of parameters in method impls.

This commit is contained in:
Markus Schorn 2006-12-14 14:09:28 +00:00
parent a857bb1867
commit c1ca84452f
2 changed files with 34 additions and 0 deletions

View file

@ -89,4 +89,36 @@ public class IndexBindingResolutionBugs extends IndexBindingResolutionTestBase {
getBindingFromASTName("fooovr('", 6); getBindingFromASTName("fooovr('", 6);
} }
// // header
// class Base {
// public:
// void foo(int i);
// int foo2(int i);
// };
//
// void func(int k);
// void func2(int i);
// // references
// #include "header.h"
// void Base::foo(int i) {
// i=2;
// }
// void Base::foo2(int j) {
// j=2;
// }
// void func(int k) {
// k=2;
// }
// void func2(int l) {
// l=2;
// }
public void test168054() {
getBindingFromASTName("i=2", 1);
getBindingFromASTName("j=2", 1);
getBindingFromASTName("k=2", 1);
getBindingFromASTName("l=2", 1);
}
} }

View file

@ -525,6 +525,8 @@ public class CPPVisitor {
} else if( temp instanceof IProblemBinding ){ } else if( temp instanceof IProblemBinding ){
//problems with the function, still create binding for the parameter //problems with the function, still create binding for the parameter
binding = new CPPParameter( name ); binding = new CPPParameter( name );
} else if ( temp instanceof IIndexBinding ) {
binding= new CPPParameter( name );
} }
} else if( parent instanceof ICPPASTTemplateDeclaration ) { } else if( parent instanceof ICPPASTTemplateDeclaration ) {
return CPPTemplates.createBinding( param ); return CPPTemplates.createBinding( param );