From b07eedb957466eed1b4c449ae9b02c6fa5c5e345 Mon Sep 17 00:00:00 2001 From: Markus Schorn Date: Wed, 31 Mar 2010 14:40:35 +0000 Subject: [PATCH] Bug 305975: Fix creation of ICElements for enumerators. --- .../core/model/ext/CElementHandleFactory.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ext/CElementHandleFactory.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ext/CElementHandleFactory.java index 17ae8b0b54b..f0e71c2198b 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ext/CElementHandleFactory.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ext/CElementHandleFactory.java @@ -26,6 +26,7 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassSpecialization; 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.ICPPEnumeration; import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunctionTemplate; import org.eclipse.cdt.core.dom.ast.cpp.ICPPMethod; import org.eclipse.cdt.core.dom.ast.cpp.ICPPNamespace; @@ -132,6 +133,17 @@ public class CElementHandleFactory { } return tu; } + + if (parentBinding instanceof IEnumeration) { + ICElement grandParent= createParent(tu, parentBinding); + if (parentBinding instanceof ICPPEnumeration && parentBinding.getNameCharArray().length > 0) { + if (grandParent != null) { + return new EnumerationHandle(grandParent, (ICPPEnumeration) parentBinding); + } + } else { + return grandParent; + } + } if (parentBinding instanceof ICPPNamespace) { char[] scopeName= parentBinding.getNameCharArray();