Skip to content

[Clang] Fix __is_trivially_equaltiy_comparable documentation #88528

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

philnik777
Copy link
Contributor

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.

@philnik777 philnik777 requested a review from AaronBallman April 12, 2024 15:39
@llvmbot llvmbot added the clang Clang issues not falling into any other category label Apr 12, 2024
@llvmbot
Copy link
Member

llvmbot commented Apr 12, 2024

@llvm/pr-subscribers-clang

Author: Nikolas Klauser (philnik777)

Changes

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.


Full diff: https://github.com/llvm/llvm-project/pull/88528.diff

1 Files Affected:

  • (modified) clang/docs/LanguageExtensions.rst (+1-1)
diff --git a/clang/docs/LanguageExtensions.rst b/clang/docs/LanguageExtensions.rst
index 7b23e4d1c2f30c..a6942464de5d35 100644
--- a/clang/docs/LanguageExtensions.rst
+++ b/clang/docs/LanguageExtensions.rst
@@ -1640,7 +1640,7 @@ 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.
 * ``__is_unbounded_array`` (C++, GNU, Microsoft, Embarcadero)
 * ``__is_union`` (C++, GNU, Microsoft, Embarcadero)
 * ``__is_unsigned`` (C++, Embarcadero):

@philnik777 philnik777 force-pushed the fix_is_trivially_equality_comparable_doc branch from d4cf4c2 to 0c93727 Compare April 22, 2024 10:16
Copy link
Collaborator

@AaronBallman AaronBallman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@philnik777 philnik777 merged commit 9aa663b into llvm:main Apr 22, 2024
@philnik777 philnik777 deleted the fix_is_trivially_equality_comparable_doc branch April 22, 2024 17:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang Clang issues not falling into any other category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants