aboutsummaryrefslogtreecommitdiff
path: root/conanfile.py
diff options
context:
space:
mode:
authorAbseil Team <absl-team@google.com>2024-04-01 09:27:16 -0700
committerCopybara-Service <copybara-worker@google.com>2024-04-01 09:28:20 -0700
commit8a31d4a8dd3d9e81eedae2d3be679423a84f33c9 (patch)
tree5b047cc6d1a90fc94d87acdc69bf80fb8f0d4a89 /conanfile.py
parent770d078368f66da606ad98187f33fbc5b8cdd3ae (diff)
downloadabseil-8a31d4a8dd3d9e81eedae2d3be679423a84f33c9.tar.gz
abseil-8a31d4a8dd3d9e81eedae2d3be679423a84f33c9.tar.bz2
abseil-8a31d4a8dd3d9e81eedae2d3be679423a84f33c9.zip
Add internal traits for lifetimebound detection
This will helps compilers that understand `ABSL_ATTRIBUTE_LIFETIME_BOUND` flag constructs such as `absl::StatusOr<std::string_view> str = std::string(...)` as error-prone. For standard types, this is done via specializing the type traits. For all other types, this is done by detecting the presence of a Boolean member trait such as: `using absl_internal_is_view = std::true_type;` in the type. This is purely intended as a safety feature, and the values of these traits (even if wrong!) must NOT be depended on for correct behavior. Furthermore, only high-value types (such as `absl::StatusOr`) are the intended users here. Do not declare or use these traits on arbitrary types that are unlikely to be misused. Do not depend on any of these to be stable, as they not (yet) public APIs. Moreover, the trait declarations and mechanisms are all subject to change. (For example, if `[[clang::lifetimebound]]` becomes possible to detect directly, the traits may need to be altered to utilize that, and distinguish between assignments and constructions.) Should these or similar APIs be made public at a later point, the detection mechanisms may be altered quickly, and may (either loudly or silently) break existing code depending on these internal APIs without notice. PiperOrigin-RevId: 620868493 Change-Id: I4a528a1dcf0df6ffbc3641d09537bc4c674aee4e
Diffstat (limited to 'conanfile.py')
0 files changed, 0 insertions, 0 deletions