Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSergey Prigogin2014-10-20 19:29:59 +0000
committerSergey Prigogin2014-10-20 19:30:45 +0000
commit0c4ddcf9224ec3ea4da7b9e17bee5e932bcb73f4 (patch)
treed401632f7bc691ba24d23817e505eb65daa69ef7
parent88a494349a02c4045d5ff5643b6ac6b15303ef84 (diff)
downloadorg.eclipse.cdt-0c4ddcf9224ec3ea4da7b9e17bee5e932bcb73f4.tar.gz
org.eclipse.cdt-0c4ddcf9224ec3ea4da7b9e17bee5e932bcb73f4.tar.xz
org.eclipse.cdt-0c4ddcf9224ec3ea4da7b9e17bee5e932bcb73f4.zip
Bug 446711 - Name resolution problem with dependent enumeration
Fixed ownership of enumeration specializations.
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPTemplates.java14
1 files changed, 7 insertions, 7 deletions
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPTemplates.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPTemplates.java
index 408fe5aea02..4c0b2c4ca23 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPTemplates.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPTemplates.java
@@ -962,7 +962,7 @@ public class CPPTemplates {
IType type= instantiateType(aliasTemplate.getType(), tpMap, -1, getSpecializationContext(owner), point);
spec = new CPPAliasTemplateInstance(decl.getNameCharArray(), aliasTemplate, type);
} else if (decl instanceof ICPPEnumeration) {
- spec = instantiateEnumeration((ICPPEnumeration) decl, getSpecializationContext(owner), tpMap, point);
+ spec = instantiateEnumeration((ICPPEnumeration) decl, owner, tpMap, point);
} else if (decl instanceof IEnumerator) {
IEnumerator enumerator = (IEnumerator) decl;
ICPPEnumeration enumeration = (ICPPEnumeration) enumerator.getOwner();
@@ -997,11 +997,12 @@ public class CPPTemplates {
return spec;
}
- private static IBinding instantiateEnumeration(ICPPEnumeration enumeration, ICPPClassSpecialization within,
+ private static IBinding instantiateEnumeration(ICPPEnumeration enumeration, ICPPClassSpecialization owner,
final ICPPTemplateParameterMap tpMap, IASTNode point) {
+ ICPPClassSpecialization within = getSpecializationContext(owner);
IType fixedType = instantiateType(enumeration.getFixedType(), tpMap, -1, within, point);
CPPEnumerationSpecialization specializedEnumeration =
- new CPPEnumerationSpecialization(enumeration, within, tpMap, fixedType);
+ new CPPEnumerationSpecialization(enumeration, owner, tpMap, fixedType);
IEnumerator[] enumerators = enumeration.getEnumerators();
IEnumerator[] specializedEnumerators = new IEnumerator[enumerators.length];
specializedEnumeration.setEnumerators(specializedEnumerators);
@@ -1015,10 +1016,9 @@ public class CPPTemplates {
internalType = ((ICPPInternalEnumerator) enumerator).getInternalType();
if (internalType != null) {
internalType = instantiateType(internalType, tpMap, -1, within, point);
- } else {
- if (previousInternalType instanceof IBasicType) {
- internalType = ASTEnumerator.getTypeOfIncrementedValue((IBasicType) previousInternalType, specializedValue);
- } }
+ } else if (previousInternalType instanceof IBasicType) {
+ internalType = ASTEnumerator.getTypeOfIncrementedValue((IBasicType) previousInternalType, specializedValue);
+ }
if (internalType != null) {
previousInternalType = internalType;
}

Back to the top