Android R Preview 1 (RPP1.200123.016)
jni: Fix templates for clang-r377782 update.

In the next clang update, non-type template parameter of function type T
is adjusted to be type "pointer to T". It follows section 17.1.8 in
c++17 standard. But it reports error when compiling code like below:

template <typename T, T fn>
class helper;

template <typename T, typename... Args, T fn(Args...)>
class helper<T(Args...), fn> {};

error: class template partial specialization is not more specialized than
  the primary template [-Winvalid-partial-specialization]

The reason is the non-type template parameter fn of
helper<T(Args...), fn> is decayed to T (*)(Args...), making the partial
specialization not match primary template <typename T, T fn>.

To fix this, use <typename T, T* fn> in the primary template. And use
function pointer type explicitly in the partial template specialization
to make code clear.

Bug: 148287303
Test: run jni_compiler_tests.

Change-Id: I99731b08032574b6fc4c1d45bba19e240e9354b4
1 file changed