Commit ccf0c773 by Abseil Team Committed by Copybara-Service

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
parent 2a636651
...@@ -120,7 +120,7 @@ struct FloatTraits<double> { ...@@ -120,7 +120,7 @@ struct FloatTraits<double> {
// Parsing a smaller N will produce something finite. // Parsing a smaller N will produce something finite.
static constexpr int kEiselLemireMaxExclusiveExp10 = 309; 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) #if ABSL_HAVE_BUILTIN(__builtin_nan)
// Use __builtin_nan() if available since it has a fix for // Use __builtin_nan() if available since it has a fix for
// https://bugs.llvm.org/show_bug.cgi?id=37778 // https://bugs.llvm.org/show_bug.cgi?id=37778
...@@ -193,7 +193,7 @@ struct FloatTraits<float> { ...@@ -193,7 +193,7 @@ struct FloatTraits<float> {
static constexpr int kEiselLemireMinInclusiveExp10 = -46 - 18; static constexpr int kEiselLemireMinInclusiveExp10 = -46 - 18;
static constexpr int kEiselLemireMaxExclusiveExp10 = 39; 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) #if ABSL_HAVE_BUILTIN(__builtin_nanf)
// Use __builtin_nanf() if available since it has a fix for // Use __builtin_nanf() if available since it has a fix for
// https://bugs.llvm.org/show_bug.cgi?id=37778 // https://bugs.llvm.org/show_bug.cgi?id=37778
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment