[PATCH] D53486: [libcxx] Only define __libcpp_is_floating_point<_Float16> for Clang

Petr Hosek via Phabricator reviews at reviews.llvm.org
Mon Oct 22 20:10:17 PDT 2018


phosek added a comment.

In https://reviews.llvm.org/D53486#1271514, @ldionne wrote:

> I see roughly two options:
>
> 1. Never provide support for `_Float16` in C++ -- `_Float16` does not appear to be part of the C11 standard according to http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1570.pdf (I think it may be part of a TS).


It's defined in ISO/IEC TS 18661-3:2015 extension to C11. I'd be fine not defining the type trait for `_Float16` at all given that it's not defined by the C++ standard.

> 2. If only GCC is not providing `_Float16` in C++ but other compilers are providing it, perhaps changing the condition to `#if !defined(__GNUC__)` (or whatever the `#define` is, and also filing a complaint against GCC for diverging from other implementations.

I don't have any way to check other compilers. I searched the ICC documentation but haven't found any mention of `_Float16`. I think it's safer to assume that only Clang defines `_Float16` in C++ rather than assuming that GCC is the only one not defining it unless we have some way to confirm that.


Repository:
  rCXX libc++

https://reviews.llvm.org/D53486





More information about the libcxx-commits mailing list