From e533381b755faadf8f1a7f7329f32a7102a0c950 Mon Sep 17 00:00:00 2001 From: Nathan Ridge Date: Wed, 2 May 2018 01:36:46 -0400 Subject: [PATCH] Bug 534126 - Cache instantiations of alias template instances This avoid runtime that's exponential in the nesting depth of alias template instances. Change-Id: Ibde6a6d98753df54e8e495a8b4547a90e8313191 --- .../parser/tests/ast2/AST2TemplateTests.java | 108 ++++++++++++++++++ .../dom/parser/cpp/CPPASTTranslationUnit.java | 11 ++ .../parser/cpp/semantics/CPPTemplates.java | 49 +++++++- 3 files changed, 163 insertions(+), 5 deletions(-) diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2TemplateTests.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2TemplateTests.java index 496f8958f62..48a9cd6539a 100644 --- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2TemplateTests.java +++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2TemplateTests.java @@ -10826,4 +10826,112 @@ public class AST2TemplateTests extends AST2CPPTestBase { public void testOverloadResolutionWithInitializerList_531322() throws Exception { parseAndCheckBindings(); } + + // using size_t = decltype(sizeof(int)); + // + // template + // using MetaApply = typename Fn::template apply; + // + // template + // struct TypeList { + // using type = TypeList; + // + // template + // using apply = MetaApply; + // }; + // + // struct Empty {}; + // + // namespace impl { + // template + // struct If_ { + // template + // using apply = T; + // }; + // template <> + // struct If_ { + // template + // using apply = U; + // }; + // } + // + // template + // using If = MetaApply, Then, Else>; + // + // template