diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2CPPTests.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2CPPTests.java index a8c41262af4..80574be3204 100644 --- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2CPPTests.java +++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2CPPTests.java @@ -9934,4 +9934,16 @@ public class AST2CPPTests extends AST2BaseTest { public void testFinalParameter() throws Exception { parseAndCheckBindings(); } + + // struct S1 {}; + // S1 s1; + // const int i= 1; + // template struct CT {}; + // typedef int TD; + // bool operator==(S1 a, int r ); + // static const int x = sizeof(CT((TD * (CT::*)) 0 )); + // template bool operator==(S1 a, const CT& r ); + public void testOrderInAmbiguityResolution_390759() throws Exception { + parseAndCheckBindings(); + } } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IScope.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IScope.java index f808c84115e..3d3bb846a23 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IScope.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IScope.java @@ -128,7 +128,7 @@ public interface IScope { fLookupPoint= point; fLookupPointIsName= false; fLookupKey= name; - fIgnorePointOfDeclaration= true; + fIgnorePointOfDeclaration= false; if (fLookupPoint == null) { fTu= null; fIgnorePointOfDeclaration= true; diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/db/TypeMarshalBuffer.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/db/TypeMarshalBuffer.java index 82ff86be4ba..d5294c33b68 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/db/TypeMarshalBuffer.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/db/TypeMarshalBuffer.java @@ -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); } }