diff options
Diffstat (limited to 'absl/log/internal')
-rw-r--r-- | absl/log/internal/conditions.h | 4 | ||||
-rw-r--r-- | absl/log/internal/log_message.h | 8 | ||||
-rw-r--r-- | absl/log/internal/nullstream.h | 11 |
3 files changed, 7 insertions, 16 deletions
diff --git a/absl/log/internal/conditions.h b/absl/log/internal/conditions.h index 645f3c23..9dc15db4 100644 --- a/absl/log/internal/conditions.h +++ b/absl/log/internal/conditions.h @@ -230,8 +230,8 @@ class LogEveryNSecState final { // Helper routines to abort the application quietly -ABSL_ATTRIBUTE_NORETURN inline void AbortQuietly() { abort(); } -ABSL_ATTRIBUTE_NORETURN inline void ExitQuietly() { _exit(1); } +[[noreturn]] inline void AbortQuietly() { abort(); } +[[noreturn]] inline void ExitQuietly() { _exit(1); } } // namespace log_internal ABSL_NAMESPACE_END } // namespace absl 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 diff --git a/absl/log/internal/nullstream.h b/absl/log/internal/nullstream.h index 9266852e..973e91ab 100644 --- a/absl/log/internal/nullstream.h +++ b/absl/log/internal/nullstream.h @@ -117,16 +117,7 @@ class NullStreamMaybeFatal final : public NullStream { class NullStreamFatal final : public NullStream { public: NullStreamFatal() = default; - // ABSL_ATTRIBUTE_NORETURN doesn't seem to work on destructors with msvc, so - // disable msvc's warning about the d'tor never returning. -#if defined(_MSC_VER) && !defined(__clang__) -#pragma warning(push) -#pragma warning(disable : 4722) -#endif - ABSL_ATTRIBUTE_NORETURN ~NullStreamFatal() { _exit(1); } -#if defined(_MSC_VER) && !defined(__clang__) -#pragma warning(pop) -#endif + [[noreturn]] ~NullStreamFatal() { _exit(1); } }; } // namespace log_internal |