================ @@ -327,6 +464,54 @@ a discriminator determined as follows: is ``ptrauth_blend_discriminator(&x, discriminator)``; see `ptrauth_blend_discriminator`_. +Non-triviality from address diversity ++++++++++++++++++++++++++++++++++++++ + +Address diversity must impose additional restrictions in order to allow the +implementation to correctly copy values. In C++, a type qualified with address +diversity is treated like a class type with non-trivial copy/move constructors +and assignment operators, with the usual effect on containing classes and +unions. C does not have a standard concept of non-triviality, and so we must +describe the basic rules here, with the intention of imitating the emergent +rules of C++: + +- A type may be **non-trivial to copy**. + +- A type may also be **illegal to copy**. Types that are illegal to copy are + always non-trivial to copy. + +- A type may also be **address-sensitive**. ---------------- kbeyls wrote:
This says a type may be 'address-sensitive', but I couldn't easily find a definition of what it means for a type to be 'address-sensitive'. Maybe the definition is later in this doc? If not I wonder if it'd be good to add an extra sentence here to define what it means. Would my guess of "When a type is address-sensitive, 2 otherwise identical objects of such type may behave differently if they are located/live at different addresses" be roughly right? Similarly, "non-trivial to copy" and "illegal to copy" don't have explicit definitions, but maybe those terms are self-explanatory enough to not need them? https://github.com/llvm/llvm-project/pull/152596 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits