1
0
Fork 0
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:
Nathan Ridge 2014-03-09 06:45:58 -04:00 committed by Sergey Prigogin
parent 6e2d669821
commit 83d0b2be3e
2 changed files with 33 additions and 2 deletions

View file

@ -7357,7 +7357,33 @@ public class AST2TemplateTests extends AST2TestBase {
public void testSFINAEInTemplatedConversionOperator_409056() throws Exception { public void testSFINAEInTemplatedConversionOperator_409056() throws Exception {
parseAndCheckImplicitNameBindings(); 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> // template <typename>
// struct M { // struct M {
// template <typename... Args> // template <typename... Args>

View file

@ -2578,7 +2578,12 @@ public class CPPSemantics {
ICPPFunctionTemplate funcTemp = (ICPPFunctionTemplate) f; ICPPFunctionTemplate funcTemp = (ICPPFunctionTemplate) f;
final ICPPTemplateParameter[] tpars = funcTemp.getTemplateParameters(); final ICPPTemplateParameter[] tpars = funcTemp.getTemplateParameters();
final CPPTemplateParameterMap map = new CPPTemplateParameterMap(tpars.length); 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 { } else {
isCandidate= args == null; isCandidate= args == null;