1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-23 14:42:11 +02:00

Bug 390759: Wrong order in ambiguity resolution.

This commit is contained in:
Markus Schorn 2012-11-13 06:45:53 +01:00
parent 7d752c9288
commit 64e6fb0537
3 changed files with 23 additions and 3 deletions

View file

@ -9934,4 +9934,16 @@ public class AST2CPPTests extends AST2BaseTest {
public void testFinalParameter() throws Exception {
parseAndCheckBindings();
}
// struct S1 {};
// S1 s1;
// const int i= 1;
// template<int I> struct CT {};
// typedef int TD;
// bool operator==(S1 a, int r );
// static const int x = sizeof(CT<i>((TD * (CT<sizeof(s1 == 1)>::*)) 0 ));
// template<int I> bool operator==(S1 a, const CT<I>& r );
public void testOrderInAmbiguityResolution_390759() throws Exception {
parseAndCheckBindings();
}
}

View file

@ -128,7 +128,7 @@ public interface IScope {
fLookupPoint= point;
fLookupPointIsName= false;
fLookupKey= name;
fIgnorePointOfDeclaration= true;
fIgnorePointOfDeclaration= false;
if (fLookupPoint == null) {
fTu= null;
fIgnorePointOfDeclaration= true;

View file

@ -189,8 +189,14 @@ public class TypeMarshalBuffer implements ITypeMarshalBuffer {
putByte(VALUE);
arg.getNonTypeEvaluation().marshal(this, true);
} else {
marshalType(arg.getTypeValue());
marshalType(arg.getOriginalTypeValue());
final IType typeValue = arg.getTypeValue();
final IType originalTypeValue = arg.getOriginalTypeValue();
marshalType(typeValue);
if (typeValue != originalTypeValue) {
marshalType(originalTypeValue);
} else {
marshalType(null);
}
}
}
@ -203,6 +209,8 @@ public class TypeMarshalBuffer implements ITypeMarshalBuffer {
fPos--;
IType type = unmarshalType();
IType originalType = unmarshalType();
if (originalType == null)
originalType= type;
return new CPPTemplateTypeArgument(type, originalType);
}
}