Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNathan Ridge2014-08-17 07:30:57 +0000
committerSergey Prigogin2014-08-17 17:34:49 +0000
commit05d86fc1d150b343dceb35c4eb3ec45a714c3d4a (patch)
tree4f53852407effab701e1e9f34d16749527f6559a
parent82f3bca7d069e3af01a7e51ad636ad8440dd4cc5 (diff)
downloadorg.eclipse.cdt-05d86fc1d150b343dceb35c4eb3ec45a714c3d4a.tar.gz
org.eclipse.cdt-05d86fc1d150b343dceb35c4eb3ec45a714c3d4a.tar.xz
org.eclipse.cdt-05d86fc1d150b343dceb35c4eb3ec45a714c3d4a.zip
Bug 439896 - Handle problem bindings in
CPPCompositesFactory.getCompositeEvaluation() Change-Id: I96a9961f39b6bf8d9109ebe0daa30194b8f3fed4 Signed-off-by: Nathan Ridge <zeratul976@hotmail.com> Reviewed-on: https://git.eclipse.org/r/31801 Reviewed-by: Sergey Prigogin <eclipse.sprigogin@gmail.com> Tested-by: Sergey Prigogin <eclipse.sprigogin@gmail.com>
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CPPCompositesFactory.java20
1 files changed, 16 insertions, 4 deletions
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CPPCompositesFactory.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CPPCompositesFactory.java
index 50b8f046ce1..f9c4632182d 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CPPCompositesFactory.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CPPCompositesFactory.java
@@ -281,7 +281,10 @@ public class CPPCompositesFactory extends AbstractCompositeFactory {
ICPPFunction parameterOwner = e.getParameterOwner();
if (parameterOwner != null) {
IType b = e.getFixedType();
- IBinding a2 = getCompositeBinding((IIndexFragmentBinding) parameterOwner);
+ IBinding a2 = parameterOwner;
+ if (parameterOwner instanceof IIndexFragmentBinding) {
+ a2 = getCompositeBinding((IIndexFragmentBinding) parameterOwner);
+ }
IType b2 = getCompositeType(b);
if (parameterOwner != a2 || b != b2 || templateDefinition != compositeTemplateDefinition) {
int parameterPosition = e.getFunctionParameterPosition();
@@ -291,7 +294,10 @@ public class CPPCompositesFactory extends AbstractCompositeFactory {
IBinding a = e.getBinding();
IType b = e.getFixedType();
- IBinding a2 = getCompositeBinding((IIndexFragmentBinding) a);
+ IBinding a2 = a;
+ if (a instanceof IIndexFragmentBinding) {
+ a2 = getCompositeBinding((IIndexFragmentBinding) a);
+ }
IType b2 = getCompositeType(b);
if (a != a2 || b != b2 || templateDefinition != compositeTemplateDefinition)
e= new EvalBinding(a2, b2, compositeTemplateDefinition);
@@ -395,7 +401,10 @@ public class CPPCompositesFactory extends AbstractCompositeFactory {
IType a = e.getOwnerType();
IBinding b = e.getMember();
IType a2= getCompositeType(a);
- IBinding b2= getCompositeBinding((IIndexFragmentBinding) b);
+ IBinding b2= b;
+ if (b instanceof IIndexFragmentBinding) {
+ b2= getCompositeBinding((IIndexFragmentBinding) b);
+ }
if (a != a2 || b != b2 || templateDefinition != compositeTemplateDefinition)
e= new EvalMemberAccess(a2, e.getOwnerValueCategory(), b2, e.isPointerDeref(), compositeTemplateDefinition);
return e;
@@ -423,7 +432,10 @@ public class CPPCompositesFactory extends AbstractCompositeFactory {
ICPPEvaluation a = e.getArgument();
ICPPEvaluation a2 = getCompositeEvaluation(a);
IBinding b= e.getAddressOfQualifiedNameBinding();
- IBinding b2= getCompositeBinding((IIndexFragmentBinding) b);
+ IBinding b2= b;
+ if (b instanceof IIndexFragmentBinding) {
+ b2= getCompositeBinding((IIndexFragmentBinding) b);
+ }
if (a != a2 || b != b2 || templateDefinition != compositeTemplateDefinition)
e= new EvalUnary(e.getOperator(), a2, b2, compositeTemplateDefinition);
return e;

Back to the top