[libcxx-commits] [PATCH] D132340: [libc++] Remove noexcept specifier from operator""s

Nikolas Klauser via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Fri Sep 2 07:21:13 PDT 2022


philnik updated this revision to Diff 457593.
philnik added a comment.

- Try to fix CI


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D132340/new/

https://reviews.llvm.org/D132340

Files:
  libcxx/include/string
  libcxx/test/std/strings/basic.string.literals/noexcept.compile.pass.cpp


Index: libcxx/test/std/strings/basic.string.literals/noexcept.compile.pass.cpp
===================================================================
--- /dev/null
+++ libcxx/test/std/strings/basic.string.literals/noexcept.compile.pass.cpp
@@ -0,0 +1,23 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++03, c++11
+
+#include <string>
+
+#include "test_macros.h"
+
+static_assert(!noexcept(std::operator""s(std::declval<const char*>(), std::declval<int>())), "");
+#ifndef TEST_HAS_NO_CHAR8_T
+static_assert(!noexcept(std::operator""s(std::declval<const char8_t*>(), std::declval<int>())), "");
+#endif
+static_assert(!noexcept(std::operator""s(std::declval<const char16_t*>(), std::declval<int>())), "");
+static_assert(!noexcept(std::operator""s(std::declval<const char32_t*>(), std::declval<int>())), "");
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
+static_assert(!noexcept(std::operator""s(std::declval<const wchar_t*>(), std::declval<int>())), "");
+#endif
Index: libcxx/include/string
===================================================================
--- libcxx/include/string
+++ libcxx/include/string
@@ -4736,7 +4736,7 @@
 
 #ifndef _LIBCPP_HAS_NO_CHAR8_T
     inline _LIBCPP_HIDE_FROM_ABI constexpr
-    basic_string<char8_t> operator "" s(const char8_t *__str, size_t __len) _NOEXCEPT
+    basic_string<char8_t> operator "" s(const char8_t *__str, size_t __len)
     {
         return basic_string<char8_t> (__str, __len);
     }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D132340.457593.patch
Type: text/x-patch
Size: 1785 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20220902/67988d24/attachment.bin>


More information about the libcxx-commits mailing list