===================================================================
@@ -57,4 +57,20 @@
}
#endif
+#if __cplusplus >= 201500L
+#define __cpp_lib_support_udls 201605
+namespace std
+{
+inline namespace literals
+{
+inline namespace support_literals
+{
+ constexpr size_t
+ operator""zu(unsigned long long __n)
+ { return static_cast<size_t>(__n); }
+}
+}
+}
+#endif // C++17
+
#endif // _GLIBCXX_CSTDDEF
===================================================================
@@ -0,0 +1,31 @@
+// { dg-options "-std=gnu++17" }
+// { dg-do compile }
+
+// Copyright (C) 2016 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+#include <cstddef>
+#include <type_traits>
+
+void
+test01()
+{
+ using namespace std::literals::support_literals;
+
+ static_assert(std::is_same<decltype(1zu), std::size_t>::value,
+ "1zu is std::size_t");
+}
===================================================================
@@ -0,0 +1,42 @@
+// { dg-options "-std=gnu++1z" }
+// { dg-do run }
+
+// Copyright (C) 2016 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+#include <cstddef>
+#include <limits>
+#include <testsuite_hooks.h>
+
+void
+test01()
+{
+ using namespace std::literals::support_literals;
+ bool test [[gnu::unused]] = true;
+
+ std::size_t s = 1zu;
+ std::size_t t = -1zu;
+
+ VERIFY( s == 1 );
+ VERIFY( t == std::numeric_limits<std::size_t>::max() );
+}
+
+int
+main()
+{
+ test01();
+}