mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Bug 429928 - False "invalid overload" due to undetected instantiation
failure. Change-Id: I6f89baa929560468eb899255875865e29d254218 Reviewed-on: https://git.eclipse.org/r/23171 Reviewed-by: Sergey Prigogin <eclipse.sprigogin@gmail.com> IP-Clean: Sergey Prigogin <eclipse.sprigogin@gmail.com> Tested-by: Sergey Prigogin <eclipse.sprigogin@gmail.com>
This commit is contained in:
parent
d3793be6d1
commit
e91e3669b7
2 changed files with 29 additions and 7 deletions
|
@ -7372,18 +7372,38 @@ public class AST2TemplateTests extends AST2TestBase {
|
|||
// };
|
||||
//
|
||||
// template <class U>
|
||||
// void
|
||||
// waldo();
|
||||
// void waldo();
|
||||
//
|
||||
// template <class U>
|
||||
// typename enable_if<A<U>::value>::type
|
||||
// waldo();
|
||||
// typename enable_if<A<U>::value>::type waldo();
|
||||
//
|
||||
// auto x = waldo<int>; // problem on valdo<int>
|
||||
public void testSfinaeWhenResolvingAddressOfFunction_429928() throws Exception {
|
||||
// auto x = waldo<int>;
|
||||
public void testSfinaeWhenResolvingAddressOfFunction_429928a() throws Exception {
|
||||
parseAndCheckBindings();
|
||||
}
|
||||
|
||||
// template<typename T>
|
||||
// struct A {};
|
||||
//
|
||||
// template<bool, typename T = void>
|
||||
// struct enable_if {};
|
||||
//
|
||||
// template<typename T>
|
||||
// struct enable_if<true, T> {
|
||||
// typedef T type;
|
||||
// };
|
||||
//
|
||||
// template <class U>
|
||||
// void waldo();
|
||||
//
|
||||
// template <class U>
|
||||
// typename enable_if<A<U>::value>::type waldo();
|
||||
//
|
||||
// auto x = waldo<int>;
|
||||
public void testSfinaeWhenResolvingAddressOfFunction_429928b() throws Exception {
|
||||
parseAndCheckBindings();
|
||||
}
|
||||
|
||||
// template <typename>
|
||||
// struct M {
|
||||
// template <typename... Args>
|
||||
|
|
|
@ -324,7 +324,7 @@ public class EvalID extends CPPDependentEvaluation {
|
|||
|
||||
if (!(type instanceof IBinding))
|
||||
return EvalFixed.INCOMPLETE;
|
||||
nameOwner = (IBinding)type;
|
||||
nameOwner = (IBinding) type;
|
||||
}
|
||||
|
||||
if (fieldOwner instanceof IProblemBinding || nameOwner instanceof IProblemBinding)
|
||||
|
@ -337,6 +337,8 @@ public class EvalID extends CPPDependentEvaluation {
|
|||
ICPPEvaluation eval = resolveName((ICPPClassType) nameOwner, templateArgs, null, point);
|
||||
if (eval != null)
|
||||
return eval;
|
||||
if (!CPPTemplates.isDependentType((ICPPClassType) nameOwner))
|
||||
return EvalFixed.INCOMPLETE;
|
||||
}
|
||||
|
||||
if (fieldOwner != null && !fieldOwner.isTypeDependent()) {
|
||||
|
|
Loading…
Add table
Reference in a new issue