[PATCH] D100794: [HIP] Support overloaded math functions for hipRTC

Artem Belevich via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 20 11:43:53 PDT 2021


tra added inline comments.


================
Comment at: clang/lib/Headers/__clang_hip_cmath.h:341
 
-  typedef decltype(__test(std::declval<_Tp>())) type;
-  static const bool value = !std::is_same<type, void>::value;
+  typedef decltype(__test(_Tp{})) type;
+  static const bool value = !is_same<type, void>::value;
----------------
tra wrote:
> @jlebar : Should we expect any observable surprises here?
`_Tp{}` may break if `_Tp` does not have a default constructor. At least it does so with C++20, while the old code did not: https://godbolt.org/z/PGEff5Mvv


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D100794/new/

https://reviews.llvm.org/D100794



More information about the cfe-commits mailing list