diff options
Diffstat (limited to 'core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/cxx17/TemplateAutoIndexTests.java')
-rw-r--r-- | core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/cxx17/TemplateAutoIndexTests.java | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/cxx17/TemplateAutoIndexTests.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/cxx17/TemplateAutoIndexTests.java new file mode 100644 index 00000000000..f3c8a7874ed --- /dev/null +++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/cxx17/TemplateAutoIndexTests.java @@ -0,0 +1,50 @@ +/******************************************************************************* + * Copyright (c) 2018 Vlad Ivanov + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Vlad Ivanov (LabSystems) - Initial implementation + *******************************************************************************/ +package org.eclipse.cdt.core.parser.tests.ast2.cxx17; + +import org.eclipse.cdt.core.dom.ast.IType; +import org.eclipse.cdt.core.dom.ast.IVariable; +import org.eclipse.cdt.internal.index.tests.IndexBindingResolutionTestBase; + +public class TemplateAutoIndexTests extends IndexBindingResolutionTestBase { + public TemplateAutoIndexTests() { + setStrategy(new SinglePDOMTestStrategy(true)); + } + + // template<typename Type, Type v> + // struct helper { + // static Type call() { + // return nullptr; + // } + // }; + // + // template<auto F> + // class call_helper { + // using functor_t = decltype(F); + // + // public: + // using type = helper<functor_t, F>; + // }; + + // struct Something { + // void foo() {} + // }; + // + // using A = call_helper<&Something::foo>::type; + // auto waldo = A::call(); + public void testTemplateAutoIndex() throws Exception { + BindingAssertionHelper helper = getAssertionHelper(); + IVariable variable = helper.assertNonProblem("waldo"); + IType variableType = variable.getType(); + + assertEquals("void (Something::*)()", variableType.toString()); + } +} |