mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-04 23:05:47 +02:00
Bug 497535 - Name resolution problem with template method
Change-Id: I6bc4025f26d19dd0162f7e6c9d9cdad73c75e5d9
This commit is contained in:
parent
18f13d204e
commit
4d6c9dce1a
2 changed files with 45 additions and 1 deletions
|
@ -3702,6 +3702,50 @@ public class AST2TemplateTests extends AST2TestBase {
|
||||||
assertInstance(mt1, ICPPFunctionTemplate.class);
|
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, typename U=T> class XT {};
|
||||||
// template <typename T> class XT<T,T> {public: int partial;};
|
// template <typename T> class XT<T,T> {public: int partial;};
|
||||||
// void test() {
|
// void test() {
|
||||||
|
|
|
@ -422,7 +422,7 @@ public class EvalID extends CPPDependentEvaluation {
|
||||||
} catch (DOMException e) {
|
} catch (DOMException e) {
|
||||||
}
|
}
|
||||||
IBinding[] bindings = data.getFoundBindings();
|
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];
|
ICPPFunction[] functions = new ICPPFunction[bindings.length];
|
||||||
System.arraycopy(bindings, 0, functions, 0, bindings.length);
|
System.arraycopy(bindings, 0, functions, 0, bindings.length);
|
||||||
return new EvalFunctionSet(new CPPFunctionSet(functions, templateArgs, null), fQualified, fAddressOf,
|
return new EvalFunctionSet(new CPPFunctionSet(functions, templateArgs, null), fQualified, fAddressOf,
|
||||||
|
|
Loading…
Add table
Reference in a new issue