mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-22 14:12:10 +02:00
Bug 533216 - Correctly classify local types as dependent or not
Change-Id: Ie34d0540fd1efa85e29dbe525b75a35af21dc7cf
This commit is contained in:
parent
ff1cfbf1d4
commit
72d9035173
2 changed files with 27 additions and 0 deletions
|
@ -3198,4 +3198,25 @@ public class IndexCPPTemplateResolutionTest extends IndexBindingResolutionTestBa
|
||||||
public void testConstexprInitListConstructor_519091() throws Exception {
|
public void testConstexprInitListConstructor_519091() throws Exception {
|
||||||
checkBindings();
|
checkBindings();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// template <typename T> T&& declval();
|
||||||
|
//
|
||||||
|
// template <typename Value, typename Func,
|
||||||
|
// typename Requires = decltype(declval<Func>()(declval<Value>()))>
|
||||||
|
// void apply(Value, Func);
|
||||||
|
//
|
||||||
|
// template <typename T>
|
||||||
|
// void callInTemplateContext(int i) {
|
||||||
|
// return apply(i, [](int x) { return T(x); });
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// void consume(int);
|
||||||
|
// void callInCpp1(int i);
|
||||||
|
|
||||||
|
// void callInCpp1(int i) {
|
||||||
|
// apply(i, &consume);
|
||||||
|
// }
|
||||||
|
public void testClassCastException_533216() throws Exception {
|
||||||
|
checkBindings();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2973,6 +2973,12 @@ public class CPPTemplates {
|
||||||
return ((InitializerListType) t).getEvaluation().isTypeDependent();
|
return ((InitializerListType) t).getEvaluation().isTypeDependent();
|
||||||
} else if (t instanceof IBinding) {
|
} else if (t instanceof IBinding) {
|
||||||
IBinding owner = ((IBinding) t).getOwner();
|
IBinding owner = ((IBinding) t).getOwner();
|
||||||
|
if (owner instanceof IFunction) {
|
||||||
|
if (owner instanceof ICPPFunctionTemplate) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
owner = owner.getOwner();
|
||||||
|
}
|
||||||
if (owner instanceof ICPPClassTemplate)
|
if (owner instanceof ICPPClassTemplate)
|
||||||
return true;
|
return true;
|
||||||
return (owner instanceof IType) && owner != t && isDependentType((IType) owner);
|
return (owner instanceof IType) && owner != t && isDependentType((IType) owner);
|
||||||
|
|
Loading…
Add table
Reference in a new issue