2017-12-01 Jonathan Wakely <jwakely@redhat.com>
+ * include/bits/basic_string.h (operator""s): Add pragmas to disable
+ -Wliteral-suffix warnings.
+ * include/experimental/string_view (operator""sv): Likewise.
+ * include/std/chrono (operator""h, operator""min, operator""s)
+ (operator""ms, operator""us, operator""ns): Likewise.
+ * include/std/complex (operator""if, operator""i, operator""il):
+ Likewise.
+ * include/std/string_view (operator""sv): Likewise.
+ * testsuite/20_util/duration/literals/range.cc: Adjust dg-error.
+
* include/bits/locale_facets_nonio.tcc (money_get::_M_extract): Add
fallthrough comment.
{
inline namespace string_literals
{
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wliteral-suffix"
_GLIBCXX_DEFAULT_ABI_TAG
inline basic_string<char>
operator""s(const char* __str, size_t __len)
{ return basic_string<char32_t>{__str, __len}; }
#endif
+#pragma GCC diagnostic pop
} // inline namespace string_literals
} // inline namespace literals
{
inline namespace string_view_literals
{
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wliteral-suffix"
inline constexpr basic_string_view<char>
operator""sv(const char* __str, size_t __len) noexcept
{ return basic_string_view<char>{__str, __len}; }
operator""sv(const char32_t* __str, size_t __len) noexcept
{ return basic_string_view<char32_t>{__str, __len}; }
#endif
+#pragma GCC diagnostic pop
} // namespace string_literals
} // namespace literals
} // namespace experimental
{
inline namespace chrono_literals
{
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wliteral-suffix"
template<typename _Rep, unsigned long long _Val>
struct _Checked_integral_constant
: integral_constant<_Rep, static_cast<_Rep>(_Val)>
operator""ns()
{ return __check_overflow<chrono::nanoseconds, _Digits...>(); }
+#pragma GCC diagnostic pop
} // inline namespace chrono_literals
} // inline namespace literals
using namespace literals::chrono_literals;
} // namespace chrono
-#endif // __cplusplus > 201103L
+#endif // C++14
// @} group chrono
inline namespace literals {
inline namespace complex_literals {
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wliteral-suffix"
#define __cpp_lib_complex_udls 201309
constexpr std::complex<float>
operator""il(unsigned long long __num)
{ return std::complex<long double>{0.0L, static_cast<long double>(__num)}; }
+#pragma GCC diagnostic pop
} // inline namespace complex_literals
} // inline namespace literals
{
inline namespace string_view_literals
{
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wliteral-suffix"
inline constexpr basic_string_view<char>
operator""sv(const char* __str, size_t __len) noexcept
{ return basic_string_view<char>{__str, __len}; }
operator""sv(const char32_t* __str, size_t __len) noexcept
{ return basic_string_view<char32_t>{__str, __len}; }
#endif
+#pragma GCC diagnostic pop
} // namespace string_literals
} // namespace literals
// std::numeric_limits<int64_t>::max() == 9223372036854775807;
auto h = 9223372036854775808h;
- // { dg-error "cannot be represented" "" { target *-*-* } 892 }
+ // { dg-error "cannot be represented" "" { target *-*-* } 894 }
}
// { dg-prune-output "in constexpr expansion" } // needed for -O0