mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-01 14:15:23 +02:00
Fix name lookup in PDOMCPPClassType, fixes 41.120 firefox problems (226.516 left)
This commit is contained in:
parent
3c449d0ac8
commit
2e79fba079
2 changed files with 10 additions and 1 deletions
|
@ -313,7 +313,7 @@ public class CPPClassScope extends CPPScope implements ICPPClassScope {
|
|||
return super.find( name );
|
||||
}
|
||||
|
||||
static protected boolean isConstructorReference( IASTName name ){
|
||||
public static boolean isConstructorReference( IASTName name ){
|
||||
if( name.getPropertyInParent() == CPPSemantics.STRING_LOOKUP_PROPERTY ) return false;
|
||||
IASTNode node = name.getParent();
|
||||
if( node instanceof ICPPASTTemplateId )
|
||||
|
|
|
@ -37,6 +37,7 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPField;
|
|||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPMethod;
|
||||
import org.eclipse.cdt.internal.core.Util;
|
||||
import org.eclipse.cdt.internal.core.dom.parser.ProblemBinding;
|
||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPClassScope;
|
||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPSemantics;
|
||||
import org.eclipse.cdt.internal.core.index.IIndexType;
|
||||
import org.eclipse.cdt.internal.core.pdom.PDOM;
|
||||
|
@ -378,6 +379,14 @@ ICPPClassScope, IPDOMMemberOwner, IIndexType {
|
|||
|
||||
public IBinding getBinding(IASTName name, boolean resolve) throws DOMException {
|
||||
try {
|
||||
if (getDBName().equals(name.toCharArray())) {
|
||||
if (CPPClassScope.isConstructorReference(name)){
|
||||
return CPPSemantics.resolveAmbiguities(name, getConstructors());
|
||||
}
|
||||
//9.2 ... The class-name is also inserted into the scope of the class itself
|
||||
return this;
|
||||
}
|
||||
|
||||
BindingCollector visitor= new BindingCollector(name.toCharArray());
|
||||
accept(visitor);
|
||||
return CPPSemantics.resolveAmbiguities(name, visitor.getBindings());
|
||||
|
|
Loading…
Add table
Reference in a new issue