[libcxx-commits] [libcxx] [libc++][RFC] Rewrite CPOs with resolver functions (PR #209104)
A. Jiang via libcxx-commits
libcxx-commits at lists.llvm.org
Thu Oct 15 03:16:45 PDT 2026
================
@@ -0,0 +1,48 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___UTILITY_CPO_H
+#define _LIBCPP___UTILITY_CPO_H
+
+#include <__config>
+#include <__utility/forward.h>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+#if _LIBCPP_STD_VER >= 20
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+struct __string {
+ consteval __string(const char*) {}
+};
+
+template <__string>
+struct __diagnostic {};
----------------
frederick-vs-ja wrote:
`__string` is currently stateless, making `__diagnostic` having only one specialization (i.e. `__diagnostic<"foo">` and `__diagnostic<"bar">` are the same type). What happens when there should be multiple different error messages?
Also, names `__string` and `__diagnostic` look a bit overly generic and easy to conflict to me...
https://github.com/llvm/llvm-project/pull/209104
More information about the libcxx-commits
mailing list