diff options
author | Andrew Ferguson | 2007-06-07 12:28:01 +0000 |
---|---|---|
committer | Andrew Ferguson | 2007-06-07 12:28:01 +0000 |
commit | b92596a0aea3597fc05413ab4f72946f0c8ae0de (patch) | |
tree | 43afbb49f765ed6a7f568223ba0f682ff8cae9dd | |
parent | de268f3094154a79e06e347a79bd39c6c7255592 (diff) | |
download | org.eclipse.cdt-b92596a0aea3597fc05413ab4f72946f0c8ae0de.tar.gz org.eclipse.cdt-b92596a0aea3597fc05413ab4f72946f0c8ae0de.tar.xz org.eclipse.cdt-b92596a0aea3597fc05413ab4f72946f0c8ae0de.zip |
177917: have composite bindings also implement ICPPDelegateCreator
16 files changed, 120 insertions, 14 deletions
diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexCPPBindingResolutionTest.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexCPPBindingResolutionTest.java index 1bae2289c19..be1fefc30d7 100644 --- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexCPPBindingResolutionTest.java +++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexCPPBindingResolutionTest.java @@ -86,7 +86,7 @@ public abstract class IndexCPPBindingResolutionTest extends IndexBindingResoluti // int g(int x) {return 4;} // int g(char x) {return 2;} // int nn= g(f(2)); - public void _testUsingTypeDirective_177917_1() { + public void testUsingTypeDirective_177917_1() { IBinding b1= getBindingFromASTName("A a", 1); IBinding b2= getBindingFromASTName("B b", 1); IBinding b3= getBindingFromASTName("C c", 1); diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPClassTemplate.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPClassTemplate.java index 7081eba8213..30e16f49fee 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPClassTemplate.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPClassTemplate.java @@ -12,17 +12,21 @@ package org.eclipse.cdt.internal.core.index.composite.cpp; import org.eclipse.cdt.core.CCorePlugin; import org.eclipse.cdt.core.dom.ast.DOMException; +import org.eclipse.cdt.core.dom.ast.IASTName; import org.eclipse.cdt.core.dom.ast.IBinding; import org.eclipse.cdt.core.dom.ast.IProblemBinding; import org.eclipse.cdt.core.dom.ast.IType; import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassTemplate; import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassTemplatePartialSpecialization; import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassType; +import org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate; import org.eclipse.cdt.core.dom.ast.cpp.ICPPSpecialization; import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateDefinition; import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateParameter; import org.eclipse.cdt.core.parser.util.ArrayUtil; +import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPClassTemplate; import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPTemplates; +import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPDelegateCreator; import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalTemplateInstantiator; import org.eclipse.cdt.internal.core.index.CIndex; import org.eclipse.cdt.internal.core.index.IIndexFragmentBinding; @@ -30,7 +34,7 @@ import org.eclipse.cdt.internal.core.index.composite.ICompositesFactory; import org.eclipse.core.runtime.CoreException; public class CompositeCPPClassTemplate extends CompositeCPPClassType implements -ICPPClassTemplate, ICPPInternalTemplateInstantiator{ +ICPPClassTemplate, ICPPDelegateCreator, ICPPInternalTemplateInstantiator { public CompositeCPPClassTemplate(ICompositesFactory cf, ICPPClassType ct) { super(cf, ct); @@ -87,5 +91,8 @@ ICPPClassTemplate, ICPPInternalTemplateInstantiator{ return CPPTemplates.instantiateTemplate(this, arguments, null); } - + + public ICPPDelegate createDelegate(IASTName name) { + return new CPPClassTemplate.CPPClassTemplateDelegate(name, this); + } } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPClassType.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPClassType.java index 22f86e299dd..c605d1b6580 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPClassType.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPClassType.java @@ -12,6 +12,7 @@ package org.eclipse.cdt.internal.core.index.composite.cpp; import org.eclipse.cdt.core.dom.IName; import org.eclipse.cdt.core.dom.ast.DOMException; +import org.eclipse.cdt.core.dom.ast.IASTName; import org.eclipse.cdt.core.dom.ast.IBinding; import org.eclipse.cdt.core.dom.ast.IField; import org.eclipse.cdt.core.dom.ast.IScope; @@ -19,14 +20,17 @@ import org.eclipse.cdt.core.dom.ast.IType; import org.eclipse.cdt.core.dom.ast.cpp.ICPPBase; import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassType; import org.eclipse.cdt.core.dom.ast.cpp.ICPPConstructor; +import org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate; import org.eclipse.cdt.core.dom.ast.cpp.ICPPField; import org.eclipse.cdt.core.dom.ast.cpp.ICPPMethod; +import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPDelegateCreator; import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBase; +import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPClassType.CPPClassTypeDelegate; import org.eclipse.cdt.internal.core.index.IIndexFragmentBinding; import org.eclipse.cdt.internal.core.index.IIndexType; import org.eclipse.cdt.internal.core.index.composite.ICompositesFactory; -class CompositeCPPClassType extends CompositeCPPBinding implements ICPPClassType, IIndexType { +class CompositeCPPClassType extends CompositeCPPBinding implements ICPPClassType, ICPPDelegateCreator, IIndexType { public CompositeCPPClassType(ICompositesFactory cf, ICPPClassType rbinding) { super(cf, rbinding); } @@ -172,4 +176,8 @@ class CompositeCPPClassType extends CompositeCPPBinding implements ICPPClassType public boolean isSameType(IType type) { return ((ICPPClassType)rbinding).isSameType(type); } + + public ICPPDelegate createDelegate(IASTName name) { + return new CPPClassTypeDelegate(name, this); + } } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPEnumeration.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPEnumeration.java index 2ff2a68b291..df4e8f3acc4 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPEnumeration.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPEnumeration.java @@ -11,15 +11,19 @@ package org.eclipse.cdt.internal.core.index.composite.cpp; import org.eclipse.cdt.core.dom.ast.DOMException; +import org.eclipse.cdt.core.dom.ast.IASTName; import org.eclipse.cdt.core.dom.ast.IEnumeration; import org.eclipse.cdt.core.dom.ast.IEnumerator; import org.eclipse.cdt.core.dom.ast.IType; import org.eclipse.cdt.core.dom.ast.cpp.ICPPBinding; +import org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate; +import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPDelegateCreator; +import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPEnumeration.CPPEnumerationDelegate; import org.eclipse.cdt.internal.core.index.IIndexFragmentBinding; import org.eclipse.cdt.internal.core.index.IIndexType; import org.eclipse.cdt.internal.core.index.composite.ICompositesFactory; -class CompositeCPPEnumeration extends CompositeCPPBinding implements IEnumeration, IIndexType { +class CompositeCPPEnumeration extends CompositeCPPBinding implements IEnumeration, ICPPDelegateCreator, IIndexType { public CompositeCPPEnumeration(ICompositesFactory cf, IEnumeration rbinding) { super(cf, (ICPPBinding) rbinding); } @@ -36,4 +40,8 @@ class CompositeCPPEnumeration extends CompositeCPPBinding implements IEnumeratio } public Object clone() { fail(); return null; } + + public ICPPDelegate createDelegate(IASTName name) { + return new CPPEnumerationDelegate(name, this); + } } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPEnumerator.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPEnumerator.java index cc192ebcb21..751071ee625 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPEnumerator.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPEnumerator.java @@ -11,13 +11,17 @@ package org.eclipse.cdt.internal.core.index.composite.cpp; import org.eclipse.cdt.core.dom.ast.DOMException; +import org.eclipse.cdt.core.dom.ast.IASTName; import org.eclipse.cdt.core.dom.ast.IEnumerator; import org.eclipse.cdt.core.dom.ast.IType; import org.eclipse.cdt.core.dom.ast.cpp.ICPPBinding; +import org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate; +import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPEnumerator; +import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPDelegateCreator; import org.eclipse.cdt.internal.core.index.IIndexType; import org.eclipse.cdt.internal.core.index.composite.ICompositesFactory; -class CompositeCPPEnumerator extends CompositeCPPBinding implements IEnumerator { +class CompositeCPPEnumerator extends CompositeCPPBinding implements IEnumerator, ICPPDelegateCreator { public CompositeCPPEnumerator(ICompositesFactory cf, IEnumerator rbinding) { super(cf, (ICPPBinding) rbinding); } @@ -26,4 +30,8 @@ class CompositeCPPEnumerator extends CompositeCPPBinding implements IEnumerator IType type = ((IEnumerator)rbinding).getType(); return cf.getCompositeType((IIndexType)type); } + + public ICPPDelegate createDelegate(IASTName name) { + return new CPPEnumerator.CPPEnumeratorDelegate(name, this); + } } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPField.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPField.java index 6f180e8ce84..8e9e4e60750 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPField.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPField.java @@ -11,15 +11,19 @@ package org.eclipse.cdt.internal.core.index.composite.cpp; import org.eclipse.cdt.core.dom.ast.DOMException; +import org.eclipse.cdt.core.dom.ast.IASTName; import org.eclipse.cdt.core.dom.ast.IBinding; import org.eclipse.cdt.core.dom.ast.ICompositeType; import org.eclipse.cdt.core.dom.ast.IField; import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassType; +import org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate; import org.eclipse.cdt.core.dom.ast.cpp.ICPPField; +import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPField; +import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPDelegateCreator; import org.eclipse.cdt.internal.core.index.IIndexFragmentBinding; import org.eclipse.cdt.internal.core.index.composite.ICompositesFactory; -class CompositeCPPField extends CompositeCPPVariable implements ICPPField { +class CompositeCPPField extends CompositeCPPVariable implements ICPPField, ICPPDelegateCreator { public CompositeCPPField(ICompositesFactory cf, ICPPField rbinding) { super(cf, rbinding); } @@ -37,4 +41,8 @@ class CompositeCPPField extends CompositeCPPVariable implements ICPPField { IBinding preresult = ((IField)rbinding).getCompositeTypeOwner(); return (ICompositeType) cf.getCompositeBinding((IIndexFragmentBinding) preresult); } + + public ICPPDelegate createDelegate(IASTName name) { + return new CPPField.CPPFieldDelegate(name, this); + } } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPFunction.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPFunction.java index 3deb07da486..17a6de27db2 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPFunction.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPFunction.java @@ -12,16 +12,20 @@ package org.eclipse.cdt.internal.core.index.composite.cpp; import org.eclipse.cdt.core.dom.ast.ASTTypeUtil; import org.eclipse.cdt.core.dom.ast.DOMException; +import org.eclipse.cdt.core.dom.ast.IASTName; import org.eclipse.cdt.core.dom.ast.IFunctionType; import org.eclipse.cdt.core.dom.ast.IParameter; import org.eclipse.cdt.core.dom.ast.IScope; import org.eclipse.cdt.core.dom.ast.IType; +import org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate; import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunction; +import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPFunction; +import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPDelegateCreator; import org.eclipse.cdt.internal.core.index.IIndexFragmentBinding; import org.eclipse.cdt.internal.core.index.IIndexType; import org.eclipse.cdt.internal.core.index.composite.ICompositesFactory; -class CompositeCPPFunction extends CompositeCPPBinding implements ICPPFunction { +class CompositeCPPFunction extends CompositeCPPBinding implements ICPPFunction, ICPPDelegateCreator { public CompositeCPPFunction(ICompositesFactory cf, ICPPFunction rbinding) { super(cf, rbinding); @@ -85,4 +89,8 @@ class CompositeCPPFunction extends CompositeCPPBinding implements ICPPFunction { } return result.toString(); } + + public ICPPDelegate createDelegate(IASTName name) { + return new CPPFunction.CPPFunctionDelegate(name, this); + } } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPFunctionTemplate.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPFunctionTemplate.java index 22aa030b0b4..a3046cde08b 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPFunctionTemplate.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPFunctionTemplate.java @@ -11,17 +11,21 @@ package org.eclipse.cdt.internal.core.index.composite.cpp; import org.eclipse.cdt.core.dom.ast.DOMException; +import org.eclipse.cdt.core.dom.ast.IASTName; import org.eclipse.cdt.core.dom.ast.IBinding; import org.eclipse.cdt.core.dom.ast.IType; +import org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate; import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunction; import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunctionTemplate; import org.eclipse.cdt.core.dom.ast.cpp.ICPPSpecialization; import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateParameter; +import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPFunctionTemplate; +import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPDelegateCreator; import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalTemplateInstantiator; import org.eclipse.cdt.internal.core.index.IIndexFragmentBinding; import org.eclipse.cdt.internal.core.index.composite.ICompositesFactory; -public class CompositeCPPFunctionTemplate extends CompositeCPPFunction implements ICPPFunctionTemplate, ICPPInternalTemplateInstantiator { +public class CompositeCPPFunctionTemplate extends CompositeCPPFunction implements ICPPFunctionTemplate, ICPPInternalTemplateInstantiator, ICPPDelegateCreator { public CompositeCPPFunctionTemplate(ICompositesFactory cf, ICPPFunction rbinding) { super(cf, rbinding); @@ -47,4 +51,7 @@ public class CompositeCPPFunctionTemplate extends CompositeCPPFunction implement return InternalTemplateInstantiatorUtil.instantiate(arguments, cf, rbinding); } + public ICPPDelegate createDelegate(IASTName name) { + return new CPPFunctionTemplate.CPPFunctionTemplateDelegate(name, this); + } } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPMethod.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPMethod.java index 3f3530ee58a..2e76ccf5fdd 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPMethod.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPMethod.java @@ -11,13 +11,17 @@ package org.eclipse.cdt.internal.core.index.composite.cpp; import org.eclipse.cdt.core.dom.ast.DOMException; +import org.eclipse.cdt.core.dom.ast.IASTName; import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassType; +import org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate; import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunction; import org.eclipse.cdt.core.dom.ast.cpp.ICPPMethod; +import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPMethod; +import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPDelegateCreator; import org.eclipse.cdt.internal.core.index.IIndexFragmentBinding; import org.eclipse.cdt.internal.core.index.composite.ICompositesFactory; -class CompositeCPPMethod extends CompositeCPPFunction implements ICPPMethod { +class CompositeCPPMethod extends CompositeCPPFunction implements ICPPMethod, ICPPDelegateCreator { public CompositeCPPMethod(ICompositesFactory cf, ICPPFunction rbinding) { super(cf, rbinding); @@ -43,4 +47,8 @@ class CompositeCPPMethod extends CompositeCPPFunction implements ICPPMethod { public int getVisibility() throws DOMException { return ((ICPPMethod)rbinding).getVisibility(); } + + public final ICPPDelegate createDelegate(IASTName name) { + return new CPPMethod.CPPMethodDelegate(name, this); + } } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPNamespace.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPNamespace.java index dba97acbfdd..cffcc37b556 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPNamespace.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPNamespace.java @@ -11,13 +11,17 @@ package org.eclipse.cdt.internal.core.index.composite.cpp; import org.eclipse.cdt.core.dom.ast.DOMException; +import org.eclipse.cdt.core.dom.ast.IASTName; import org.eclipse.cdt.core.dom.ast.IBinding; +import org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate; import org.eclipse.cdt.core.dom.ast.cpp.ICPPNamespace; import org.eclipse.cdt.core.dom.ast.cpp.ICPPNamespaceScope; +import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPNamespace; +import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPDelegateCreator; import org.eclipse.cdt.internal.core.index.IIndexFragmentBinding; import org.eclipse.cdt.internal.core.index.composite.ICompositesFactory; -class CompositeCPPNamespace extends CompositeCPPBinding implements ICPPNamespace { +class CompositeCPPNamespace extends CompositeCPPBinding implements ICPPNamespace, ICPPDelegateCreator { ICPPNamespace[] namespaces; public CompositeCPPNamespace(ICompositesFactory cf, ICPPNamespace[] namespaces) { super(cf, namespaces[0]); @@ -37,4 +41,8 @@ class CompositeCPPNamespace extends CompositeCPPBinding implements ICPPNamespace public ICPPNamespaceScope getNamespaceScope() throws DOMException { return new CompositeCPPNamespaceScope(cf, namespaces); } + + public ICPPDelegate createDelegate(IASTName name) { + return new CPPNamespace.CPPNamespaceDelegate(name, this); + } } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPParameter.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPParameter.java index b5fe14741f1..c5b4edb93f4 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPParameter.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPParameter.java @@ -10,11 +10,15 @@ *******************************************************************************/ package org.eclipse.cdt.internal.core.index.composite.cpp; +import org.eclipse.cdt.core.dom.ast.IASTName; +import org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate; import org.eclipse.cdt.core.dom.ast.cpp.ICPPParameter; import org.eclipse.cdt.core.dom.ast.cpp.ICPPVariable; +import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPParameter; +import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPDelegateCreator; import org.eclipse.cdt.internal.core.index.composite.ICompositesFactory; -class CompositeCPPParameter extends CompositeCPPVariable implements ICPPParameter { +class CompositeCPPParameter extends CompositeCPPVariable implements ICPPParameter, ICPPDelegateCreator { public CompositeCPPParameter(ICompositesFactory cf, ICPPVariable rbinding) { super(cf, rbinding); } @@ -22,4 +26,8 @@ class CompositeCPPParameter extends CompositeCPPVariable implements ICPPParamete public boolean hasDefaultValue() { return ((ICPPParameter)rbinding).hasDefaultValue(); } + + public ICPPDelegate createDelegate(IASTName name) { + return new CPPParameter.CPPParameterDelegate(name, this); + } } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPTypedef.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPTypedef.java index 1509b71721b..99978e20ff1 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPTypedef.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPTypedef.java @@ -11,10 +11,13 @@ package org.eclipse.cdt.internal.core.index.composite.cpp; import org.eclipse.cdt.core.dom.ast.DOMException; +import org.eclipse.cdt.core.dom.ast.IASTName; import org.eclipse.cdt.core.dom.ast.IType; import org.eclipse.cdt.core.dom.ast.ITypedef; import org.eclipse.cdt.core.dom.ast.cpp.ICPPBinding; +import org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate; import org.eclipse.cdt.internal.core.dom.parser.ITypeContainer; +import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPTypedef; import org.eclipse.cdt.internal.core.index.CPPTypedefClone; import org.eclipse.cdt.internal.core.index.IIndexType; import org.eclipse.cdt.internal.core.index.composite.ICompositesFactory; @@ -40,4 +43,8 @@ class CompositeCPPTypedef extends CompositeCPPBinding implements ITypedef, IInde public Object clone() { return new CPPTypedefClone(this); } + + public ICPPDelegate createDelegate(IASTName name) { + return new CPPTypedef.CPPTypedefDelegate(name, this); + } } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPVariable.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPVariable.java index 8a72cda8faa..60afba0bd87 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPVariable.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPVariable.java @@ -11,12 +11,16 @@ package org.eclipse.cdt.internal.core.index.composite.cpp; import org.eclipse.cdt.core.dom.ast.DOMException; +import org.eclipse.cdt.core.dom.ast.IASTName; import org.eclipse.cdt.core.dom.ast.IType; +import org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate; import org.eclipse.cdt.core.dom.ast.cpp.ICPPVariable; +import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPVariable; +import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPDelegateCreator; import org.eclipse.cdt.internal.core.index.IIndexType; import org.eclipse.cdt.internal.core.index.composite.ICompositesFactory; -class CompositeCPPVariable extends CompositeCPPBinding implements ICPPVariable { +class CompositeCPPVariable extends CompositeCPPBinding implements ICPPVariable, ICPPDelegateCreator { public CompositeCPPVariable(ICompositesFactory cf, ICPPVariable delegate) { super(cf, delegate); @@ -46,4 +50,8 @@ class CompositeCPPVariable extends CompositeCPPBinding implements ICPPVariable { public boolean isStatic() throws DOMException { return ((ICPPVariable)rbinding).isStatic(); } + + public ICPPDelegate createDelegate(IASTName name) { + return new CPPVariable.CPPVariableDelegate(name, this); + } } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPClassTemplate.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPClassTemplate.java index 91828e0c5b4..bf151a03911 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPClassTemplate.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPClassTemplate.java @@ -29,6 +29,7 @@ import org.eclipse.cdt.core.dom.ast.ITypedef; import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassTemplate; import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassTemplatePartialSpecialization; import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassType; +import org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate; import org.eclipse.cdt.core.dom.ast.cpp.ICPPSpecialization; import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateDefinition; import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateInstance; @@ -39,6 +40,7 @@ import org.eclipse.cdt.core.index.IndexFilter; import org.eclipse.cdt.core.parser.util.ArrayUtil; 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.CPPClassTemplate; import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPDeferredClassInstance; import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPSemantics; import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPTemplates; @@ -412,4 +414,8 @@ class PDOMCPPClassTemplate extends PDOMCPPClassType return false; } + + public ICPPDelegate createDelegate(IASTName name) { + return new CPPClassTemplate.CPPClassTemplateDelegate(name, this); + } } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPClassTemplatePartialSpecialization.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPClassTemplatePartialSpecialization.java index c5753e588a0..51f78bfc344 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPClassTemplatePartialSpecialization.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPClassTemplatePartialSpecialization.java @@ -240,6 +240,13 @@ class PDOMCPPClassTemplatePartialSpecialization extends return type.isSameType(this); } + if (type instanceof PDOMNode) { + PDOMNode node= (PDOMNode) type; + if (node.getPDOM() == getPDOM()) { + return node.getRecord() == getRecord(); + } + } + if( type instanceof ICPPSpecialization ) { ICPPClassType ct1= (ICPPClassType) getSpecializedBinding(); ICPPClassType ct2= (ICPPClassType) ((ICPPSpecialization)type).getSpecializedBinding(); diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/selection/CPPSelectionTestsAnyIndexer.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/selection/CPPSelectionTestsAnyIndexer.java index cde2cc14995..0053447a138 100644 --- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/selection/CPPSelectionTestsAnyIndexer.java +++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/selection/CPPSelectionTestsAnyIndexer.java @@ -489,7 +489,7 @@ public abstract class CPPSelectionTestsAnyIndexer extends BaseSelectionTestsInde // #include "testBug168533.h" // using N::d; // declares // int a= d; - public void _testBug168533() throws Exception { + public void testBug168533() throws Exception { StringBuffer[] buffers= getContents(2); String hcode= buffers[0].toString(); String scode= buffers[1].toString(); |