File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
clang/include/clang/Basic Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -4433,7 +4433,14 @@ destroy the object before returning. The lifetime of the copy of the parameter
44334433in the caller ends without a destructor call when the call begins.
44344434
44354435If a type is trivial for the purpose of calls, it is assumed to be trivially
4436- relocatable for the purpose of ``__is_trivially_relocatable``.
4436+ relocatable for the purpose of ``__is_trivially_relocatable`` and
4437+ ``__builtin_is_cpp_trivially_relocatable``.
4438+ When a type marked with ``[[trivial_abi]]`` is used as a function argument,
4439+ the compiler may omit the call to the copy constructor.
4440+ Thus, side effects of the copy constructor are potentially not performed.
4441+ For example, objects that contain pointers to themselves or otherwise depend
4442+ on their address (or the address or their subobjects) should not be declared
4443+ ``[[trivial_abi]]``.
44374444
44384445Attribute ``trivial_abi`` has no effect in the following cases:
44394446
You can’t perform that action at this time.
0 commit comments