Accept __is_same_as as a GCC-compatibility synonym for the proper trait name __is_same.

This commit is contained in:
Richard Smith 2019-10-29 14:44:38 -07:00
parent f919be3365
commit eb535d2341
4 changed files with 8 additions and 0 deletions

View File

@ -1157,6 +1157,7 @@ The following type trait primitives are supported by Clang. Those traits marked
* ``__is_reference`` (C++, Embarcadero)
* ``__is_rvalue_reference`` (C++, Embarcadero)
* ``__is_same`` (C++, Embarcadero)
* ``__is_same_as`` (GCC): Synonym for ``__is_same``.
* ``__is_scalar`` (C++, Embarcadero)
* ``__is_sealed`` (Microsoft):
Synonym for ``__is_final``.

View File

@ -524,6 +524,8 @@ TYPE_TRAIT_2(__is_same, IsSame, KEYCXX)
TYPE_TRAIT_2(__is_convertible, IsConvertible, KEYCXX)
KEYWORD(__array_rank , KEYCXX)
KEYWORD(__array_extent , KEYCXX)
// Name for GCC 6 compatibility.
ALIAS("__is_same_as", __is_same, KEYCXX)
// Apple Extension.
KEYWORD(__private_extern__ , KEYALL)

View File

@ -29,6 +29,7 @@
!__has_builtin(__array_rank) || \
!__has_builtin(__underlying_type) || \
!__has_builtin(__is_trivial) || \
!__has_builtin(__is_same_as) || \
!__has_builtin(__has_unique_object_representations)
#error Clang should have these
#endif

View File

@ -1960,6 +1960,10 @@ void is_same()
int t10[F(__is_same(Base, const Base))];
int t11[F(__is_same(Base, Base&))];
int t12[F(__is_same(Base, Derived))];
// __is_same_as is a GCC compatibility synonym for __is_same.
int t20[T(__is_same_as(int, int))];
int t21[F(__is_same_as(int, float))];
}
struct IntWrapper