1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-29 11:55:40 +02:00

Bug 233889.

This commit is contained in:
Sergey Prigogin 2008-08-05 03:53:26 +00:00
parent 7bf06f5e35
commit fe9a0ddd82
4 changed files with 20 additions and 10 deletions

View file

@ -1008,7 +1008,7 @@ public abstract class IndexCPPBindingResolutionTest extends IndexBindingResoluti
// func(&C::m1);
// func(&C::m2);
// }
public void _testAddressOfConstMethod_233889() throws Exception {
public void testAddressOfConstMethod_233889() throws Exception {
IBinding fn1= getBindingFromASTName("func(&C::m1", 4, ICPPFunction.class);
IBinding fn2= getBindingFromASTName("func(&C::m2", 4, ICPPFunction.class);
assertNotSame(fn1, fn2);

View file

@ -23,6 +23,7 @@ import org.eclipse.cdt.core.dom.ast.ITypedef;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTPointerToMember;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTQualifiedName;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassType;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunctionType;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPPointerToMemberType;
import org.eclipse.cdt.internal.core.index.IIndexType;
@ -91,4 +92,14 @@ public class CPPPointerToMemberType extends CPPPointerType implements ICPPPointe
}
return classType;
}
@Override
public boolean isConst() {
return super.isConst() || (getType() instanceof ICPPFunctionType && ((ICPPFunctionType) getType()).isConst());
}
@Override
public boolean isVolatile() {
return super.isVolatile() || (getType() instanceof ICPPFunctionType && ((ICPPFunctionType) getType()).isVolatile());
}
}

View file

@ -665,7 +665,6 @@ public class CPPSemantics {
nextTmplScope= enclosingTemplateScope(data.astName);
}
while (nextScope != null || nextTmplScope != null) {
// when the non-template scope is no longer contained within the first template scope,
// we use the template scope for the next iteration.
@ -2051,7 +2050,7 @@ public class CPPSemantics {
boolean isImpliedObject= false;
for (int j = 0; j < sourceLen; j++) {
if (useImplicitObj > 0) {
isImpliedObject= j==0;
isImpliedObject= (j == 0);
source= isImpliedObject ? impliedObjectType : sourceParameters[j - 1];
Object se= isImpliedObject || data.functionParameters.length == 0 ? null : data.functionParameters[j - 1];
sourceExp= se instanceof IASTExpression ? (IASTExpression) se : null;

View file

@ -87,7 +87,7 @@ class PDOMCPPPointerToMemberType extends PDOMPointerType implements ICPPPointerT
}
@Override
public Object clone() {
return new PDOMCPPPointerToMemberTypeClone(this);
return new PDOMCPPPointerToMemberTypeClone((ICPPPointerToMemberType) delegate);
}
}