summaryrefslogtreecommitdiff
path: root/absl
diff options
context:
space:
mode:
Diffstat (limited to 'absl')
-rw-r--r--absl/strings/charconv.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/absl/strings/charconv.cc b/absl/strings/charconv.cc
index db2b392e..88bd7eaf 100644
--- a/absl/strings/charconv.cc
+++ b/absl/strings/charconv.cc
@@ -347,7 +347,11 @@ bool HandleEdgeCase(const strings_internal::ParsedFloat& input, bool negative,
} else {
ptrdiff_t nan_size = input.subrange_end - input.subrange_begin;
nan_size = std::min(nan_size, kNanBufferSize - 1);
+#ifdef __GNUC__
+ std::copy_n(input.subrange_begin, nan_size, n_char_sequence);
+#else
std::copy_n(input.subrange_begin, nan_size, const_cast<char *>(n_char_sequence));
+#endif
n_char_sequence[nan_size] = '\0';
}
char* nan_argument = const_cast<char*>(n_char_sequence);