[libcxx-commits] [libcxx] [libc++] Use [[clang::no_specializations]] to diagnose invalid user specializations (PR #118167)

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Wed Jan 8 08:07:44 PST 2025


================
@@ -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, c++14
+
+// UNSUPPORTED: libcpp-has-no-incomplete-pstl
+
+// Check that user-specializations are diagnosed
+// See [execpol.type]/3
+
+#include <execution>
+
+// expected-no-diagnostics
+
+struct S {};
+
+template <>
+struct std::is_execution_policy<S>; // TODO
----------------
ldionne wrote:

I think I would just disable the diagnostic locally for these specializations.

https://github.com/llvm/llvm-project/pull/118167


More information about the libcxx-commits mailing list