mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-23 08:55:25 +02:00
Bug 245030.
This commit is contained in:
parent
e8efeee1b0
commit
ca322a621a
4 changed files with 14 additions and 17 deletions
|
@ -894,7 +894,7 @@ public class IndexCPPTemplateResolutionTest extends IndexBindingResolutionTestBa
|
|||
// A a;
|
||||
// func(&a, &A::m);
|
||||
// }
|
||||
public void _testFunctionTemplate_245030() throws Exception {
|
||||
public void testFunctionTemplate_245030() throws Exception {
|
||||
IBinding b0= getBindingFromASTName("func(&a, &A::m)", 4);
|
||||
assertInstance(b0, ICPPTemplateInstance.class);
|
||||
assertInstance(b0, ICPPFunction.class);
|
||||
|
|
|
@ -773,8 +773,7 @@ public class CPPTemplates {
|
|||
* @throws DOMException
|
||||
*/
|
||||
static protected Object[] deduceTemplateFunctionArguments(ICPPFunctionTemplate primaryTemplate,
|
||||
IASTParameterDeclaration[] ps, ICPPASTTemplateId id) throws DOMException
|
||||
{
|
||||
IASTParameterDeclaration[] ps, ICPPASTTemplateId id) throws DOMException {
|
||||
ICPPTemplateParameter[] templateParameters = primaryTemplate.getTemplateParameters();
|
||||
IType[] arguments= createTemplateArgumentArray(id);
|
||||
IType[] result = new IType[templateParameters.length];
|
||||
|
@ -1450,7 +1449,7 @@ public class CPPTemplates {
|
|||
}
|
||||
ObjectMap map= new ObjectMap(specArgs.length);
|
||||
int len= all ? specArgs.length : Math.min(specArgs.length, args.length);
|
||||
for (int j=0; j<len; j++) {
|
||||
for (int j= 0; j < len; j++) {
|
||||
try {
|
||||
if (!deduceTemplateArgument(map, specArgs[j], args[j])) {
|
||||
return null;
|
||||
|
|
|
@ -1,17 +1,18 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2007 Symbian Software Systems and others.
|
||||
* Copyright (c) 2007, 2008 Symbian Software Systems and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* Andrew Ferguson (Symbian) - Initial implementation
|
||||
* Andrew Ferguson (Symbian) - Initial implementation
|
||||
* Sergey Prigogin (Google)
|
||||
*******************************************************************************/
|
||||
package org.eclipse.cdt.internal.core.index.composite.cpp;
|
||||
|
||||
import org.eclipse.cdt.core.dom.ast.DOMException;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassType;
|
||||
import org.eclipse.cdt.core.dom.ast.IType;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPPointerToMemberType;
|
||||
import org.eclipse.cdt.internal.core.index.IIndexFragmentBinding;
|
||||
import org.eclipse.cdt.internal.core.index.composite.CompositePointerType;
|
||||
|
@ -23,8 +24,8 @@ class CompositeCPPPointerToMemberType extends CompositePointerType implements IC
|
|||
super(pointerToMemberType, cf);
|
||||
}
|
||||
|
||||
public ICPPClassType getMemberOfClass() {
|
||||
public IType getMemberOfClass() {
|
||||
IIndexFragmentBinding rbinding = (IIndexFragmentBinding) ((ICPPPointerToMemberType) type).getMemberOfClass();
|
||||
return (ICPPClassType) cf.getCompositeBinding(rbinding);
|
||||
return (IType) cf.getCompositeBinding(rbinding);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2006, 2007 Wind River Systems, Inc. and others.
|
||||
* Copyright (c) 2006, 2008 Wind River Systems, Inc. and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
|
@ -8,13 +8,13 @@
|
|||
* Contributors:
|
||||
* Markus Schorn - initial API and implementation
|
||||
* Bryan Wilkinson (QNX)
|
||||
* Sergey Prigogin (Google)
|
||||
*******************************************************************************/
|
||||
|
||||
package org.eclipse.cdt.internal.core.pdom.dom.cpp;
|
||||
|
||||
import org.eclipse.cdt.core.CCorePlugin;
|
||||
import org.eclipse.cdt.core.dom.ast.IType;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassType;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPPointerToMemberType;
|
||||
import org.eclipse.cdt.internal.core.index.IIndexCPPBindingConstants;
|
||||
import org.eclipse.cdt.internal.core.index.PointerTypeClone;
|
||||
|
@ -60,13 +60,10 @@ class PDOMCPPPointerToMemberType extends PDOMPointerType implements ICPPPointerT
|
|||
return IIndexCPPBindingConstants.CPP_POINTER_TO_MEMBER_TYPE;
|
||||
}
|
||||
|
||||
public ICPPClassType getMemberOfClass() {
|
||||
public IType getMemberOfClass() {
|
||||
try {
|
||||
int rec;
|
||||
rec = pdom.getDB().getInt(record + TYPE);
|
||||
if (rec != 0) {
|
||||
return new PDOMCPPClassType(pdom, rec);
|
||||
}
|
||||
int rec = pdom.getDB().getInt(record + TYPE);
|
||||
return (IType) getLinkage().getNode(rec);
|
||||
} catch (CoreException e) {
|
||||
CCorePlugin.log(e);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue