diff options
author | Derek Mauro <dmauro@google.com> | 2024-07-01 09:32:18 -0700 |
---|---|---|
committer | Copybara-Service <copybara-worker@google.com> | 2024-07-01 09:33:14 -0700 |
commit | 649f58927db8f223098be81ab5d8a70469848806 (patch) | |
tree | 13ab5d607e85a7947e58e330ea2dbf4389ad7707 /absl/status/internal/statusor_internal.h | |
parent | 57f04ad892729f798da520a80394cf25afe085e8 (diff) | |
download | abseil-649f58927db8f223098be81ab5d8a70469848806.tar.gz abseil-649f58927db8f223098be81ab5d8a70469848806.tar.bz2 abseil-649f58927db8f223098be81ab5d8a70469848806.zip |
Deprecate `ABSL_ATTRIBUTE_NORETURN` in favor of the `[[noreturn]]`
standardized in C++11
Migrate all Abseil code to `[[noreturn]]`. Notably,
https://github.com/abseil/abseil-cpp/issues/1698 reports that
`[[noreturn]]` works better here.
We can't migrate `ABSL_ATTRIBUTE_NORETURN` to use `[[noreturn]]`
because the difference in accepted attribute placement
breaks some code.
PiperOrigin-RevId: 648395324
Change-Id: Icd3e9b837aac25f128e8994de099f1edb3cabccf
Diffstat (limited to 'absl/status/internal/statusor_internal.h')
-rw-r--r-- | absl/status/internal/statusor_internal.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/absl/status/internal/statusor_internal.h b/absl/status/internal/statusor_internal.h index 414aa300..67603156 100644 --- a/absl/status/internal/statusor_internal.h +++ b/absl/status/internal/statusor_internal.h @@ -186,7 +186,7 @@ class Helper { public: // Move type-agnostic error handling to the .cc. static void HandleInvalidStatusCtorArg(absl::Nonnull<Status*>); - ABSL_ATTRIBUTE_NORETURN static void Crash(const absl::Status& status); + [[noreturn]] static void Crash(const absl::Status& status); }; // Construct an instance of T in `p` through placement new, passing Args... to @@ -438,7 +438,7 @@ struct MoveAssignBase<T, false> { MoveAssignBase& operator=(MoveAssignBase&&) = delete; }; -ABSL_ATTRIBUTE_NORETURN void ThrowBadStatusOrAccess(absl::Status status); +[[noreturn]] void ThrowBadStatusOrAccess(absl::Status status); // Used to introduce jitter into the output of printing functions for // `StatusOr` (i.e. `AbslStringify` and `operator<<`). |