mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-23 14:42:11 +02:00
Bug 429928 - SFINAE when resolving address of function
Change-Id: I2edb6becd4b79c7943e1e4b7c046afb25e398a31 Signed-off-by: Nathan Ridge <zeratul976@hotmail.com> Reviewed-on: https://git.eclipse.org/r/23090 Tested-by: Hudson CI 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
6e2d669821
commit
83d0b2be3e
2 changed files with 33 additions and 2 deletions
|
@ -7358,6 +7358,32 @@ public class AST2TemplateTests extends AST2TestBase {
|
|||
parseAndCheckImplicitNameBindings();
|
||||
}
|
||||
|
||||
// template<typename T>
|
||||
// struct A {
|
||||
// static constexpr bool value = false;
|
||||
// };
|
||||
//
|
||||
// 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>; // problem on valdo<int>
|
||||
public void testSfinaeWhenResolvingAddressOfFunction_429928() throws Exception {
|
||||
parseAndCheckBindings();
|
||||
}
|
||||
|
||||
// template <typename>
|
||||
// struct M {
|
||||
// template <typename... Args>
|
||||
|
|
|
@ -2578,7 +2578,12 @@ public class CPPSemantics {
|
|||
ICPPFunctionTemplate funcTemp = (ICPPFunctionTemplate) f;
|
||||
final ICPPTemplateParameter[] tpars = funcTemp.getTemplateParameters();
|
||||
final CPPTemplateParameterMap map = new CPPTemplateParameterMap(tpars.length);
|
||||
isCandidate= TemplateArgumentDeduction.addExplicitArguments(funcTemp, tpars, args, map, point);
|
||||
if (!TemplateArgumentDeduction.addExplicitArguments(funcTemp, tpars, args, map, point)) {
|
||||
isCandidate= false;
|
||||
} else {
|
||||
f = CPPTemplates.instantiateForAddressOfFunction(funcTemp, null, args, point);
|
||||
isCandidate= f != null;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
isCandidate= args == null;
|
||||
|
|
Loading…
Add table
Reference in a new issue