Reactor: add overload of rr::Call for void(...)
For example, the following would fail to compile because Call tries to
return a result:
struct Class
{
static void Foo()
{
}
};
Function<Void()> function;
{
Call(SomeClass::Foo);
Return();
}
Bug: b/142132927
Change-Id: I249144aabae1dcfc4cb04a174ae698445be382d2
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/37268
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Tested-by: Antonio Maiorano <amaiorano@google.com>
diff --git a/src/Reactor/Reactor.hpp b/src/Reactor/Reactor.hpp
index 597c983..f4bc9b0 100644
--- a/src/Reactor/Reactor.hpp
+++ b/src/Reactor/Reactor.hpp
@@ -3225,6 +3225,14 @@
return CallHelper<Return(Arguments...)>::Call(fptr, args...);
}
+ // Calls the function pointer fptr with the given arguments args.
+ // Overload for calling functions with void return type.
+ template<typename ... Arguments>
+ inline void Call(void(fptr)(Arguments...), CToReactor<Arguments>... args)
+ {
+ CallHelper<void(Arguments...)>::Call(fptr, args...);
+ }
+
// Calls the function pointer fptr with the signature FUNCTION_SIGNATURE and
// arguments.
template<typename FUNCTION_SIGNATURE, typename ... Arguments>