diff --git a/tcmalloc/internal/logging.cc b/tcmalloc/internal/logging.cc index c6da7f295..2fba62012 100644 --- a/tcmalloc/internal/logging.cc +++ b/tcmalloc/internal/logging.cc @@ -145,10 +145,8 @@ void RecordCrash(absl::string_view detector, absl::string_view error) { RecordTestFailure(detector, error); } -ABSL_ATTRIBUTE_NOINLINE -ABSL_ATTRIBUTE_NORETURN -static void Crash(const char* filename, int line, const char* msg, - size_t msglen, bool oom) { +[[noreturn]] ABSL_ATTRIBUTE_NOINLINE static void Crash( + const char* filename, int line, const char* msg, size_t msglen, bool oom) { StackTrace trace; trace.depth = absl::GetStackTrace(trace.stack, kMaxStackDepth, 1); @@ -184,8 +182,8 @@ static void Crash(const char* filename, int line, const char* msg, abort(); } -ABSL_ATTRIBUTE_NORETURN void CheckFailed(const char* file, int line, - const char* msg, int msglen) { +[[noreturn]] void CheckFailed(const char* file, int line, const char* msg, + int msglen) { Crash(file, line, msg, msglen, false); } diff --git a/tcmalloc/internal/logging.h b/tcmalloc/internal/logging.h index d979cb8af..73090c9f1 100644 --- a/tcmalloc/internal/logging.h +++ b/tcmalloc/internal/logging.h @@ -101,12 +101,12 @@ struct StackTrace { __LINE__, ##__VA_ARGS__) void RecordCrash(absl::string_view detector, absl::string_view error); -ABSL_ATTRIBUTE_NORETURN void CrashWithOOM(size_t alloc_size); -ABSL_ATTRIBUTE_NORETURN void CheckFailed(const char* file, int line, - const char* msg, int msglen); +[[noreturn]] void CrashWithOOM(size_t alloc_size); +[[noreturn]] void CheckFailed(const char* file, int line, const char* msg, + int msglen); template -ABSL_ATTRIBUTE_NORETURN ABSL_ATTRIBUTE_NOINLINE void CheckFailed( +[[noreturn]] ABSL_ATTRIBUTE_NOINLINE void CheckFailed( const char* func, const char* file, int line, const absl::FormatSpec& format, const Args&... args) {