1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-23 17:05:26 +02:00

Bug 497535 - Name resolution problem with template method

Change-Id: I6bc4025f26d19dd0162f7e6c9d9cdad73c75e5d9
This commit is contained in:
Sergey Prigogin 2016-07-11 14:11:26 -07:00
parent 18f13d204e
commit 4d6c9dce1a
2 changed files with 45 additions and 1 deletions

View file

@ -3702,6 +3702,50 @@ public class AST2TemplateTests extends AST2TestBase {
assertInstance(mt1, ICPPFunctionTemplate.class);
}
// template <typename T>
// struct A {
// template <typename U>
// static U m();
// };
//
// template <typename T, typename U = decltype(A<T>::template m<char>())>
// class B {};
//
// template <typename T>
// void waldo(T p);
//
// template <typename T>
// typename B<T>::type waldo(T p);
//
// void test() {
// waldo(1);
// }
public void testMethodTemplate_497535a() throws Exception {
parseAndCheckBindings();
}
// template <typename T>
// struct A {
// template <typename U>
// static U m();
// };
//
// template <typename T, typename U = decltype(A<T>::template m())>
// class B {};
//
// template <typename T>
// void waldo(T p);
//
// template <typename T>
// typename B<T>::type waldo(T p);
//
// void test() {
// waldo(1);
// }
public void testMethodTemplate_497535b() throws Exception {
parseAndCheckBindings();
}
// template <typename T, typename U=T> class XT {};
// template <typename T> class XT<T,T> {public: int partial;};
// void test() {

View file

@ -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,