[PATCH] Use __is_same_as for std::is_same and std::is_same_v

Romain Geissler romain.geissler@gmail.com
Sat Oct 12 16:14:00 GMT 2019


Le sam. 12 oct. 2019 à 17:44, Romain Geissler
<romain.geissler@gmail.com> a écrit :
>
> It looks like this creates the following error when I try to bootstrap
> clang 9.0.0 using the latest gcc and libstdc++ from trunk. Note that
> with g++, there is no problem, however it looks like clang++ has some
> problem with the new header. I don't know if this is an issue on
> libstdc++ side or clang++ side.

__is_same_as is not implemented as a compiler builtin in clang++
unlike g++, thus the error on clang 9.0.0 side. It looks like current
clang trunk doesn't define __is_same_as either. Until clang implements
this support (if it ever will), usage of __is_same_as in libstdc++
shall be conditional, only when __has_builtin(__is_same_as) is true
(however that would require that gcc implements __has_builtin, as
implemented here:
https://gcc.gnu.org/ml/gcc-patches/2019-10/msg00062.html )

Cheers,
Romain



More information about the Libstdc++ mailing list