diff options
author | Markus Schorn | 2009-07-02 12:08:43 +0000 |
---|---|---|
committer | Markus Schorn | 2009-07-02 12:08:43 +0000 |
commit | fd1791462d385998244255172b24c9bda776b975 (patch) | |
tree | e9d60220e8f8b6a7c7456dcd2a606af10bac58fd /core/org.eclipse.cdt.core.tests | |
parent | 3b0413f2603f91e2c29b951d2d10df8a6625090d (diff) | |
download | org.eclipse.cdt-fd1791462d385998244255172b24c9bda776b975.tar.gz org.eclipse.cdt-fd1791462d385998244255172b24c9bda776b975.tar.xz org.eclipse.cdt-fd1791462d385998244255172b24c9bda776b975.zip |
Type-deduction in function-type with reference type parameter, bug 281783.
Diffstat (limited to 'core/org.eclipse.cdt.core.tests')
-rw-r--r-- | core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2TemplateTests.java | 13 |
1 files changed, 12 insertions, 1 deletions
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 6d4640725d0..7bd7fc4d7e5 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 @@ -2271,6 +2271,17 @@ public class AST2TemplateTests extends AST2BaseTest { parseAndCheckBindings(code, ParserLanguage.CPP); } + + // template<class U> void f1(void(*f)(const U&)) {} + // void f2(const int& b){} + // void test() { + // f1(&f2); // problem on f1 + // } + public void testSimplifiedFunctionTemplateWithFunctionPointer_281783() throws Exception { + final String code = getAboveComment(); + parseAndCheckBindings(code, ParserLanguage.CPP); + } + // template <class T> // class A {}; // @@ -2284,7 +2295,7 @@ public class AST2TemplateTests extends AST2BaseTest { // void test(A<B> x) { // f1(x, &f2); // } - public void _testFunctionTemplateWithFunctionPointer_281783() throws Exception { + public void testFunctionTemplateWithFunctionPointer_281783() throws Exception { BindingAssertionHelper bh= new BindingAssertionHelper(getAboveComment(), true); bh.assertNonProblem("f1(x, &f2);", 2, ICPPFunction.class); } |