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 8e6a8d34bd4..7c437876bed 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 @@ -3702,6 +3702,50 @@ public class AST2TemplateTests extends AST2TestBase { assertInstance(mt1, ICPPFunctionTemplate.class); } + // template + // struct A { + // template + // static U m(); + // }; + // + // template ::template m())> + // class B {}; + // + // template + // void waldo(T p); + // + // template + // typename B::type waldo(T p); + // + // void test() { + // waldo(1); + // } + public void testMethodTemplate_497535a() throws Exception { + parseAndCheckBindings(); + } + + // template + // struct A { + // template + // static U m(); + // }; + // + // template ::template m())> + // class B {}; + // + // template + // void waldo(T p); + // + // template + // typename B::type waldo(T p); + // + // void test() { + // waldo(1); + // } + public void testMethodTemplate_497535b() throws Exception { + parseAndCheckBindings(); + } + // template class XT {}; // template class XT {public: int partial;}; // void test() { diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/EvalID.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/EvalID.java index 5c7fe24a13f..3f5b508668e 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/EvalID.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/EvalID.java @@ -422,7 +422,7 @@ public class EvalID extends CPPDependentEvaluation { } catch (DOMException e) { } IBinding[] bindings = data.getFoundBindings(); - if (bindings.length > 1 && bindings[0] instanceof ICPPFunction) { + if (bindings.length >= 1 && bindings[0] instanceof ICPPFunction) { ICPPFunction[] functions = new ICPPFunction[bindings.length]; System.arraycopy(bindings, 0, functions, 0, bindings.length); return new EvalFunctionSet(new CPPFunctionSet(functions, templateArgs, null), fQualified, fAddressOf,