summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Abseil Team <absl-team@google.com>2024-01-04 12:01:34 -0800
committerGravatar Copybara-Service <copybara-worker@google.com>2024-01-04 12:02:20 -0800
commitccf0c7730db976d2b7814e74f6f01d044ae6f853 (patch)
tree97dedaf3a5ae50be4c2999aa9ab3d21c1357ced1
parent2a636651729cec997a433ce8e363c6344130944e (diff)
Correct nullability annotations on MakeNan
Neither GCC nor Clang's __builtin_nan(), nor glibc's nan(), accept null pointers. PiperOrigin-RevId: 595767225 Change-Id: I4cddd1cafd0c9e83a823ec68386f10ce077c6b4c
-rw-r--r--absl/strings/charconv.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/absl/strings/charconv.cc b/absl/strings/charconv.cc
index eda6d506..0c9227f8 100644
--- a/absl/strings/charconv.cc
+++ b/absl/strings/charconv.cc
@@ -120,7 +120,7 @@ struct FloatTraits<double> {
// Parsing a smaller N will produce something finite.
static constexpr int kEiselLemireMaxExclusiveExp10 = 309;
- static double MakeNan(absl::Nullable<const char*> tagp) {
+ static double MakeNan(absl::Nonnull<const char*> tagp) {
#if ABSL_HAVE_BUILTIN(__builtin_nan)
// Use __builtin_nan() if available since it has a fix for
// https://bugs.llvm.org/show_bug.cgi?id=37778
@@ -193,7 +193,7 @@ struct FloatTraits<float> {
static constexpr int kEiselLemireMinInclusiveExp10 = -46 - 18;
static constexpr int kEiselLemireMaxExclusiveExp10 = 39;
- static float MakeNan(absl::Nullable<const char*> tagp) {
+ static float MakeNan(absl::Nonnull<const char*> tagp) {
#if ABSL_HAVE_BUILTIN(__builtin_nanf)
// Use __builtin_nanf() if available since it has a fix for
// https://bugs.llvm.org/show_bug.cgi?id=37778