1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

Bug 390759: Wrong order in ambiguity resolution.

This commit is contained in:
Markus Schorn 2012-11-13 06:45:53 +01:00 committed by Sergey Prigogin
parent eec6c3de73
commit 6a7e58815c
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 { public void testFinalParameter() throws Exception {
parseAndCheckBindings(); 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; fLookupPoint= point;
fLookupPointIsName= false; fLookupPointIsName= false;
fLookupKey= name; fLookupKey= name;
fIgnorePointOfDeclaration= true; fIgnorePointOfDeclaration= false;
if (fLookupPoint == null) { if (fLookupPoint == null) {
fTu= null; fTu= null;
fIgnorePointOfDeclaration= true; fIgnorePointOfDeclaration= true;

View file

@ -189,8 +189,14 @@ public class TypeMarshalBuffer implements ITypeMarshalBuffer {
putByte(VALUE); putByte(VALUE);
arg.getNonTypeEvaluation().marshal(this, true); arg.getNonTypeEvaluation().marshal(this, true);
} else { } else {
marshalType(arg.getTypeValue()); final IType typeValue = arg.getTypeValue();
marshalType(arg.getOriginalTypeValue()); 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--; fPos--;
IType type = unmarshalType(); IType type = unmarshalType();
IType originalType = unmarshalType(); IType originalType = unmarshalType();
if (originalType == null)
originalType= type;
return new CPPTemplateTypeArgument(type, originalType); return new CPPTemplateTypeArgument(type, originalType);
} }
} }