From e44e3d3e395e158133a24dcf8d4e4e13eb211cde Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Sat, 31 Jan 2015 23:00:22 +0000 Subject: [PATCH] Sun studio workaround for callback testcase --- Examples/test-suite/callback.i | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Examples/test-suite/callback.i b/Examples/test-suite/callback.i index c4d50d3fe..8e28dad06 100644 --- a/Examples/test-suite/callback.i +++ b/Examples/test-suite/callback.i @@ -57,6 +57,22 @@ return pf(a); } +#if defined(__SUNPRO_CC) +// workaround for: Error: Could not find a match for foobar_T(int, extern "C" int(*)(int)). + extern "C" { + typedef int (*foobar_int_int)(int a); + typedef double (*foobar_double_double)(double a); + }; + template + int foobar_T(int a, foobar_int_int pf) { + return pf(a); + } + template + double foobar_T(double a, foobar_double_double pf) { + return pf(a); + } +#endif + template const T& ident(const T& x) { return x;