From 7e267a47915bb79d384528be5be713e6fd3c10fd Mon Sep 17 00:00:00 2001 From: Nathan Ridge Date: Tue, 19 Nov 2019 21:28:15 -0500 Subject: [PATCH] Bug 553141 - Fix logic error in TypeInstantiationRequest.equals() Change-Id: Ie458f44a4384233ef96ed18e46f38fde309c7399 --- .../tests/ast2/cxx17/TemplateAutoTests.java | 33 +++++++++++++++++++ .../semantics/TypeInstantiationRequest.java | 2 +- 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/cxx17/TemplateAutoTests.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/cxx17/TemplateAutoTests.java index 17d86ac772e..c44bce54333 100644 --- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/cxx17/TemplateAutoTests.java +++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/cxx17/TemplateAutoTests.java @@ -75,4 +75,37 @@ public class TemplateAutoTests extends AST2CPPTestBase { public void testTemplateNontypeParameterTypeDeductionParsing_519361_3() throws Exception { parseAndCheckBindings(); } + + // template + // struct meta { using type = int; }; + // + // template + // struct remove_noexcept { using type = T; }; + // + // template + // using remove_noexcept_t = typename remove_noexcept::type; + // + // template + // struct K : meta,Key>{}; + // + // template + // struct W { + // using type = typename K::type; + // }; + // + // template + // struct M {}; + // + // struct A { + // int foo; + // }; + // typedef M::type> M1; // typedef #1 + // + // struct B { + // int foo; + // }; + // typedef M::type> M2; // typedef #2 + public void testInstantiationCacheConflict_553141() throws Exception { + parseAndCheckBindings(); + } } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/TypeInstantiationRequest.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/TypeInstantiationRequest.java index e667de7196d..96d652981f5 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/TypeInstantiationRequest.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/TypeInstantiationRequest.java @@ -80,7 +80,7 @@ public class TypeInstantiationRequest { return true; if (type1 == null || type2 == null) return false; - return type1.isSameType(type1); + return type1.isSameType(type2); } private boolean equals(ICPPTemplateParameterMap map1, ICPPTemplateParameterMap map2) {