[clang] 9aa663b - [Clang] Fix __is_trivially_equaltiy_comparable documentation (#88528)
via cfe-commits
cfe-commits at lists.llvm.org
Mon Apr 22 10:26:36 PDT 2024
Author: Nikolas Klauser
Date: 2024-04-22T19:26:33+02:00
New Revision: 9aa663bb9ef3dbab8ccc324ef3df5138aa458fbd
URL: https://github.com/llvm/llvm-project/commit/9aa663bb9ef3dbab8ccc324ef3df5138aa458fbd
DIFF: https://github.com/llvm/llvm-project/commit/9aa663bb9ef3dbab8ccc324ef3df5138aa458fbd.diff
LOG: [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.
Added:
Modified:
clang/docs/LanguageExtensions.rst
Removed:
################################################################################
diff --git a/clang/docs/LanguageExtensions.rst b/clang/docs/LanguageExtensions.rst
index 3bead159c8f946..84fc4dee02fa80 100644
--- a/clang/docs/LanguageExtensions.rst
+++ b/clang/docs/LanguageExtensions.rst
@@ -1642,7 +1642,8 @@ The following type trait primitives are supported by Clang. Those traits marked
were made trivially relocatable via the ``clang::trivial_abi`` attribute.
* ``__is_trivially_equality_comparable`` (Clang): Returns true if comparing two
objects of the provided type is known to be equivalent to comparing their
- value representations.
+ object representations. Note that types containing padding bytes are never
+ trivially equality comparable.
* ``__is_unbounded_array`` (C++, GNU, Microsoft, Embarcadero)
* ``__is_union`` (C++, GNU, Microsoft, Embarcadero)
* ``__is_unsigned`` (C++, Embarcadero):
More information about the cfe-commits
mailing list