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/log/internal/log_message.h | |
parent | 57f04ad892729f798da520a80394cf25afe085e8 (diff) |
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/log/internal/log_message.h')
-rw-r--r-- | absl/log/internal/log_message.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/absl/log/internal/log_message.h b/absl/log/internal/log_message.h index fa721214..0c067da9 100644 --- a/absl/log/internal/log_message.h +++ b/absl/log/internal/log_message.h @@ -187,11 +187,11 @@ class LogMessage { protected: // Call `abort()` or similar to perform `LOG(FATAL)` crash. It is assumed // that the caller has already generated and written the trace as appropriate. - ABSL_ATTRIBUTE_NORETURN static void FailWithoutStackTrace(); + [[noreturn]] static void FailWithoutStackTrace(); // Similar to `FailWithoutStackTrace()`, but without `abort()`. Terminates // the process with an error exit code. - ABSL_ATTRIBUTE_NORETURN static void FailQuietly(); + [[noreturn]] static void FailQuietly(); // Dispatches the completed `absl::LogEntry` to applicable `absl::LogSink`s. // This might as well be inlined into `~LogMessage` except that @@ -354,7 +354,7 @@ class LogMessageFatal final : public LogMessage { LogMessageFatal(const char* file, int line) ABSL_ATTRIBUTE_COLD; LogMessageFatal(const char* file, int line, absl::string_view failure_msg) ABSL_ATTRIBUTE_COLD; - ABSL_ATTRIBUTE_NORETURN ~LogMessageFatal(); + [[noreturn]] ~LogMessageFatal(); }; // `LogMessageDebugFatal` ensures the process will exit in failure after logging @@ -381,7 +381,7 @@ class LogMessageQuietlyFatal final : public LogMessage { LogMessageQuietlyFatal(const char* file, int line) ABSL_ATTRIBUTE_COLD; LogMessageQuietlyFatal(const char* file, int line, absl::string_view failure_msg) ABSL_ATTRIBUTE_COLD; - ABSL_ATTRIBUTE_NORETURN ~LogMessageQuietlyFatal(); + [[noreturn]] ~LogMessageQuietlyFatal(); }; } // namespace log_internal |