aboutsummaryrefslogtreecommitdiff
path: root/absl/base/attributes.h
diff options
context:
space:
mode:
authorDerek Mauro <dmauro@google.com>2024-07-01 09:32:18 -0700
committerCopybara-Service <copybara-worker@google.com>2024-07-01 09:33:14 -0700
commit649f58927db8f223098be81ab5d8a70469848806 (patch)
tree13ab5d607e85a7947e58e330ea2dbf4389ad7707 /absl/base/attributes.h
parent57f04ad892729f798da520a80394cf25afe085e8 (diff)
downloadabseil-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/base/attributes.h')
-rw-r--r--absl/base/attributes.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/absl/base/attributes.h b/absl/base/attributes.h
index e781995e..5acbdb6c 100644
--- a/absl/base/attributes.h
+++ b/absl/base/attributes.h
@@ -195,6 +195,9 @@
// ABSL_ATTRIBUTE_NORETURN
//
// Tells the compiler that a given function never returns.
+//
+// Deprecated: Prefer the `[[noreturn]]` attribute standardized by C++11 over
+// this macro.
#if ABSL_HAVE_ATTRIBUTE(noreturn) || (defined(__GNUC__) && !defined(__clang__))
#define ABSL_ATTRIBUTE_NORETURN __attribute__((noreturn))
#elif defined(_MSC_VER)