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>
|
// template <class U>
|
||||||
// void
|
// void waldo();
|
||||||
// waldo();
|
|
||||||
//
|
//
|
||||||
// template <class U>
|
// template <class U>
|
||||||
// typename enable_if<A<U>::value>::type
|
// typename enable_if<A<U>::value>::type waldo();
|
||||||
// waldo();
|
|
||||||
//
|
//
|
||||||
// auto x = waldo<int>; // problem on valdo<int>
|
// auto x = waldo<int>;
|
||||||
public void testSfinaeWhenResolvingAddressOfFunction_429928() throws Exception {
|
public void testSfinaeWhenResolvingAddressOfFunction_429928a() throws Exception {
|
||||||
parseAndCheckBindings();
|
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>
|
// template <typename>
|
||||||
// struct M {
|
// struct M {
|
||||||
// template <typename... Args>
|
// template <typename... Args>
|
||||||
|
|
|
@ -324,7 +324,7 @@ public class EvalID extends CPPDependentEvaluation {
|
||||||
|
|
||||||
if (!(type instanceof IBinding))
|
if (!(type instanceof IBinding))
|
||||||
return EvalFixed.INCOMPLETE;
|
return EvalFixed.INCOMPLETE;
|
||||||
nameOwner = (IBinding)type;
|
nameOwner = (IBinding) type;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fieldOwner instanceof IProblemBinding || nameOwner instanceof IProblemBinding)
|
if (fieldOwner instanceof IProblemBinding || nameOwner instanceof IProblemBinding)
|
||||||
|
@ -337,6 +337,8 @@ public class EvalID extends CPPDependentEvaluation {
|
||||||
ICPPEvaluation eval = resolveName((ICPPClassType) nameOwner, templateArgs, null, point);
|
ICPPEvaluation eval = resolveName((ICPPClassType) nameOwner, templateArgs, null, point);
|
||||||
if (eval != null)
|
if (eval != null)
|
||||||
return eval;
|
return eval;
|
||||||
|
if (!CPPTemplates.isDependentType((ICPPClassType) nameOwner))
|
||||||
|
return EvalFixed.INCOMPLETE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fieldOwner != null && !fieldOwner.isTypeDependent()) {
|
if (fieldOwner != null && !fieldOwner.isTypeDependent()) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue