1
0
Fork 0
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:
Nathan Ridge 2018-04-05 03:05:56 -04:00
parent ff1cfbf1d4
commit 72d9035173
2 changed files with 27 additions and 0 deletions

View file

@ -3198,4 +3198,25 @@ public class IndexCPPTemplateResolutionTest extends IndexBindingResolutionTestBa
public void testConstexprInitListConstructor_519091() throws Exception {
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();
}
}

View file

@ -2973,6 +2973,12 @@ public class CPPTemplates {
return ((InitializerListType) t).getEvaluation().isTypeDependent();
} else if (t instanceof IBinding) {
IBinding owner = ((IBinding) t).getOwner();
if (owner instanceof IFunction) {
if (owner instanceof ICPPFunctionTemplate) {
return true;
}
owner = owner.getOwner();
}
if (owner instanceof ICPPClassTemplate)
return true;
return (owner instanceof IType) && owner != t && isDependentType((IType) owner);