[libcxx-commits] [libcxx] [libc++] cv-qualified types in atomic and atomic_ref (P3323R1) (PR #121414)
Damien L-G via libcxx-commits
libcxx-commits at lists.llvm.org
Thu Jan 2 05:47:45 PST 2025
================
@@ -0,0 +1,25 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+// <atomic>
+
+// template <class T>
+// struct atomic;
+
+// This test checks that we static_assert inside std::atomic<T> when T
+// is cv-qualified, however Clang will sometimes emit additional
+// errors while trying to instantiate the rest of std::atomic<T>.
+// We silence those to make the test more robust.
+// ADDITIONAL_COMPILE_FLAGS: -Xclang -verify-ignore-unexpected=error
+
+#include <atomic>
+
+void f() {
+ std::atomic<const int> a; // expected-error@*:* {{std::atomic<T> requires that 'T' be a cv-unqualified type}}
----------------
dalg24 wrote:
Added
https://github.com/llvm/llvm-project/pull/121414
More information about the libcxx-commits
mailing list