diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2TemplateTests.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2TemplateTests.java index b60d2b353d7..be91211289e 100644 --- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2TemplateTests.java +++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2TemplateTests.java @@ -7357,7 +7357,33 @@ public class AST2TemplateTests extends AST2TestBase { public void testSFINAEInTemplatedConversionOperator_409056() throws Exception { parseAndCheckImplicitNameBindings(); } - + + // template + // struct A { + // static constexpr bool value = false; + // }; + // + // template + // struct enable_if {}; + // + // template + // struct enable_if { + // typedef T type; + // }; + // + // template + // void + // waldo(); + // + // template + // typename enable_if::value>::type + // waldo(); + // + // auto x = waldo; // problem on valdo + public void testSfinaeWhenResolvingAddressOfFunction_429928() throws Exception { + parseAndCheckBindings(); + } + // template // struct M { // template diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPSemantics.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPSemantics.java index f87f6863ec2..1c3bf1b8a2a 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPSemantics.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPSemantics.java @@ -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;