Skip to content

Commit 9aa663b

Browse files
authored
[Clang] Fix __is_trivially_equaltiy_comparable documentation (#88528)
Currently `__is_trivially_equality_comparable` is documented to return true if comparing the value representation is equivalent to calling the comparison operator, which is not quite what the trait actually checks. The traits actually checks that comparing the object representation is equivalent, which means that there cannot be padding bytes in the type.
1 parent 180cf4d commit 9aa663b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

clang/docs/LanguageExtensions.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1642,7 +1642,8 @@ The following type trait primitives are supported by Clang. Those traits marked
16421642
were made trivially relocatable via the ``clang::trivial_abi`` attribute.
16431643
* ``__is_trivially_equality_comparable`` (Clang): Returns true if comparing two
16441644
objects of the provided type is known to be equivalent to comparing their
1645-
value representations.
1645+
object representations. Note that types containing padding bytes are never
1646+
trivially equality comparable.
16461647
* ``__is_unbounded_array`` (C++, GNU, Microsoft, Embarcadero)
16471648
* ``__is_union`` (C++, GNU, Microsoft, Embarcadero)
16481649
* ``__is_unsigned`` (C++, Embarcadero):

0 commit comments

Comments
 (0)