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 bb429562e67..3e1bc2db256 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 @@ -5402,4 +5402,18 @@ public class AST2TemplateTests extends AST2BaseTest { public void testAddressOfMethodForInstantiation_Bug344310() throws Exception { parseAndCheckBindings(); } + + // template struct Callback { + // Callback(void (*function)(Arg arg)) {} + // }; + // + // void Subscribe(const Callback& callback){} + // void CallMe(const int){} + // + // int test() { + // Subscribe(Callback(&CallMe)); // invalid arguments, symbol not + // } + public void testParameterAdjustementInInstantiatedFunctionType_351609() throws Exception { + parseAndCheckBindings(); + } } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPTemplates.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPTemplates.java index a8c9c6cb1b7..cb5e1389025 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPTemplates.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPTemplates.java @@ -1054,6 +1054,13 @@ public class CPPTemplates { if (ret == r && params == ps) { return type; } + // The parameter types need to be adjusted. + for (int i=0; i