From a53d8f3f717878fb4480e7ae56488ecdbf3ab79c Mon Sep 17 00:00:00 2001 From: Sergey Prigogin Date: Sun, 5 Aug 2012 16:25:29 -0700 Subject: [PATCH] Bug 374993. Added a failing test - AST2TemplateTests._testDependentExpressionsDecltype. --- .../parser/tests/ast2/AST2TemplateTests.java | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) 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 1195974b73f..c1bcafa8798 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 @@ -5635,6 +5635,42 @@ public class AST2TemplateTests extends AST2BaseTest { parseAndCheckBindings(); } + // template + // struct A { + // typedef T type; + // }; + // + // template + // struct B {}; + // + // template > + // struct C { + // struct D { + // template + // static typename V::pointer test(typename V::pointer*); + // template + // static T* test(...); + // + // typedef typename A::type E; + // typedef decltype(test(0)) type; + // }; + // + // typedef typename D::type pointer; + // }; + // + // void f(int*); + // void f(int); + // + // void test(C::pointer a) { + // f(a); + // } + public void _testDependentExpressionsDecltype() throws Exception { + parseAndCheckBindings(); + BindingAssertionHelper bh= new BindingAssertionHelper(getAboveComment(), CPP); + ICPPFunction func= bh.assertNonProblem("f(a)", 1, ICPPFunction.class); + assertFalse(func instanceof ICPPUnknownBinding); + } + // template void* foo(int); // template void f(T t) { // if (T* i = foo<0>(0))