1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-14 03:35:37 +02:00

Bug 510834 - Propagate substitute failure in EvalID.instantiate() with field owner

Change-Id: I27088b7da18f7fe52d77bd669e32b225a1e99d21
This commit is contained in:
Nathan Ridge 2017-01-24 00:47:57 -05:00
parent e832c49faf
commit 5babeafa31
2 changed files with 37 additions and 0 deletions

View file

@ -10018,4 +10018,39 @@ public class AST2TemplateTests extends AST2TestBase {
// Just check that resolution does not throw an exception.
helper.findName("waldo").resolveBinding();
}
// template <typename Ty>
// struct has_rbegin_impl {
// typedef char yes[1];
// typedef char no[2];
// template <typename Inner>
// static yes& test(Inner *I, decltype(I->rbegin()) * = nullptr);
// template <typename >
// static no& test(...);
// static const bool value = sizeof(test<Ty>(nullptr)) == sizeof(yes);
// };
//
// template <bool, typename _Tp = void>
// struct enable_if {};
//
// template <typename _Tp>
// struct enable_if<true, _Tp> {
// typedef _Tp type;
// };
//
// template <typename Container>
// void reverse(Container&& C, typename enable_if<has_rbegin_impl<Container>::value>::type * = nullptr);
//
// template <typename Container>
// void reverse(Container&& C, typename enable_if<!has_rbegin_impl<Container>::value>::type * = nullptr);
//
// class MyContainer{};
//
// int main() {
// MyContainer c;
// reverse(c); // Ambiguous
// }
public void testWaldo_510834() throws Exception {
parseAndCheckBindings();
}
}

View file

@ -393,6 +393,8 @@ public class EvalID extends CPPDependentEvaluation {
ICPPEvaluation eval = resolveName((ICPPClassType) fieldOwnerClassType, fieldOwner, templateArgs, fieldOwnerClassTypeCV, context.getPoint());
if (eval != null)
return eval;
if (!CPPTemplates.isDependentType(fieldOwnerClassType))
return EvalFixed.INCOMPLETE;
}
}