Closed jiawen closed 10 months ago
It seems that compilers were missing complete support for this until recently. It works with GCC 12+ and Clang 15+.
Ah good to know. Xcode 15 should come with Clang 15. Thanks. I'll close this.
FYI, this still doesn't work with Xcode 15.2 (Apple clang version 15.0.0 (clang-1500.1.0.2.5)).
Describe the issue
Half-precision floating point is widely used in image processing and is well supported by [GCC](https://gcc.gnu.org/onlinedocs/gcc/Half-Precision.html] and Clang as
_Float16
. However, it appears to be incompatible withTYPED_TEST_SUITE
.Steps to reproduce the problem
Use
TYPED_TEST_SUITE
with_Float16
like below:This results in the following error on my arm64 Mac.
What version of GoogleTest are you using?
1.11.0
What operating system and version are you using?
MacOS Ventura 13.4
What compiler and version are you using?
What build system are you using?
bazel 6.1.1
Additional context
I assume the problem is because
_Float16
is a "primitive" or "trivial" type for which GoogleTest expectsstd::string testing::internal::GetTypeName<T>()
to have specializations. And that it is not a problem for other custom types like astruct
.Indeed, if I add this terrible hack / workaround, the problem goes away:
The test runs and I get something that looks like: