[libcxx-commits] [libcxx] [libc++] Stop using strict availability markup on Apple (PR #91346)
via libcxx-commits
libcxx-commits at lists.llvm.org
Tue May 7 08:16:08 PDT 2024
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff 30cfe2b2ace51a8fa0eeb64f136e3999f87971ad 42771ec1128bc37448235cd45da8ffebc3feff8e -- libcxx/include/__availability libcxx/include/print libcxx/test/libcxx/diagnostics/format.nodiscard.verify.cpp libcxx/test/libcxx/input.output/iostream.format/print.fun/vprint_unicode_posix.pass.cpp libcxx/test/libcxx/input.output/iostream.format/print.fun/vprint_unicode_windows.pass.cpp libcxx/test/libcxx/thread/atomic.availability.verify.cpp libcxx/test/libcxx/thread/barrier.availability.verify.cpp libcxx/test/libcxx/thread/latch.availability.verify.cpp libcxx/test/libcxx/thread/semaphore.availability.verify.cpp libcxx/test/libcxx/time/time.zone/time.zone.info/time.zone.info.local/ostream.pass.cpp libcxx/test/libcxx/time/time.zone/time.zone.info/time.zone.info.sys/ostream.pass.cpp libcxx/test/libcxx/utilities/format/format.functions/ascii.pass.cpp libcxx/test/libcxx/utilities/format/format.functions/escaped_output.ascii.pass.cpp libcxx/test/std/atomics/atomics.types.generic/general.compile.pass.cpp libcxx/test/std/atomics/atomics.types.generic/pointer.compile.pass.cpp libcxx/test/std/containers/sequences/vector.bool/vector.bool.fmt/format.functions.format.pass.cpp libcxx/test/std/containers/sequences/vector.bool/vector.bool.fmt/format.functions.vformat.pass.cpp libcxx/test/std/input.output/iostream.format/print.fun/no_file_description.pass.cpp libcxx/test/std/input.output/iostream.format/print.fun/print.file.pass.cpp libcxx/test/std/input.output/iostream.format/print.fun/print.sh.cpp libcxx/test/std/input.output/iostream.format/print.fun/println.file.pass.cpp libcxx/test/std/input.output/iostream.format/print.fun/println.sh.cpp libcxx/test/std/input.output/iostream.format/print.fun/vprint_nonunicode.file.pass.cpp libcxx/test/std/input.output/iostream.format/print.fun/vprint_nonunicode.sh.cpp libcxx/test/std/input.output/iostream.format/print.fun/vprint_unicode.file.pass.cpp libcxx/test/std/input.output/iostream.format/print.fun/vprint_unicode.sh.cpp libcxx/test/std/thread/thread.threads/thread.thread.class/thread.thread.id/format.functions.format.pass.cpp libcxx/test/std/thread/thread.threads/thread.thread.class/thread.thread.id/format.functions.vformat.pass.cpp libcxx/test/std/thread/thread.threads/thread.thread.class/thread.thread.id/stream.pass.cpp libcxx/test/std/time/time.cal/time.cal.day/time.cal.day.nonmembers/ostream.pass.cpp libcxx/test/std/time/time.cal/time.cal.md/time.cal.md.nonmembers/ostream.pass.cpp libcxx/test/std/time/time.cal/time.cal.mdlast/ostream.pass.cpp libcxx/test/std/time/time.cal/time.cal.month/time.cal.month.nonmembers/ostream.pass.cpp libcxx/test/std/time/time.cal/time.cal.mwd/time.cal.mwd.nonmembers/ostream.pass.cpp libcxx/test/std/time/time.cal/time.cal.mwdlast/time.cal.mwdlast.nonmembers/ostream.pass.cpp libcxx/test/std/time/time.cal/time.cal.wdidx/time.cal.wdidx.nonmembers/ostream.pass.cpp libcxx/test/std/time/time.cal/time.cal.wdlast/time.cal.wdlast.nonmembers/ostream.pass.cpp libcxx/test/std/time/time.cal/time.cal.weekday/time.cal.weekday.nonmembers/ostream.pass.cpp libcxx/test/std/time/time.cal/time.cal.year/time.cal.year.nonmembers/ostream.pass.cpp libcxx/test/std/time/time.cal/time.cal.ym/time.cal.ym.nonmembers/ostream.pass.cpp libcxx/test/std/time/time.cal/time.cal.ymd/time.cal.ymd.nonmembers/ostream.pass.cpp libcxx/test/std/time/time.cal/time.cal.ymdlast/time.cal.ymdlast.nonmembers/ostream.pass.cpp libcxx/test/std/time/time.cal/time.cal.ymwd/time.cal.ymwd.nonmembers/ostream.pass.cpp libcxx/test/std/time/time.cal/time.cal.ymwdlast/time.cal.ymwdlast.nonmembers/ostream.pass.cpp libcxx/test/std/time/time.duration/time.duration.nonmember/ostream.pass.cpp libcxx/test/std/time/time.syn/formatter.day.pass.cpp libcxx/test/std/time/time.syn/formatter.file_time.pass.cpp libcxx/test/std/time/time.syn/formatter.hh_mm_ss.pass.cpp libcxx/test/std/time/time.syn/formatter.local_time.pass.cpp libcxx/test/std/time/time.syn/formatter.month.pass.cpp libcxx/test/std/time/time.syn/formatter.month_day.pass.cpp libcxx/test/std/time/time.syn/formatter.month_day_last.pass.cpp libcxx/test/std/time/time.syn/formatter.month_weekday.pass.cpp libcxx/test/std/time/time.syn/formatter.sys_time.pass.cpp libcxx/test/std/time/time.syn/formatter.weekday.pass.cpp libcxx/test/std/time/time.syn/formatter.weekday_index.pass.cpp libcxx/test/std/time/time.syn/formatter.weekday_last.pass.cpp libcxx/test/std/time/time.syn/formatter.year.pass.cpp libcxx/test/std/time/time.syn/formatter.year_month.pass.cpp libcxx/test/std/time/time.syn/formatter.year_month_day.pass.cpp libcxx/test/std/time/time.syn/formatter.year_month_day_last.pass.cpp libcxx/test/std/time/time.syn/formatter.year_month_weekday.pass.cpp libcxx/test/std/time/time.syn/formatter.year_month_weekday_last.pass.cpp libcxx/test/std/time/time.zone/time.zone.info/time.zone.info.local/ostream.pass.cpp libcxx/test/std/utilities/format/format.functions/P2418.pass.cpp libcxx/test/std/utilities/format/format.functions/escaped_output.unicode.pass.cpp libcxx/test/std/utilities/format/format.functions/fill.unicode.pass.cpp libcxx/test/std/utilities/format/format.functions/format.locale.verify.cpp libcxx/test/std/utilities/format/format.functions/format.verify.cpp libcxx/test/std/utilities/format/format.functions/format_to.locale.verify.cpp libcxx/test/std/utilities/format/format.functions/format_to.verify.cpp libcxx/test/std/utilities/format/format.functions/format_to_n.locale.verify.cpp libcxx/test/std/utilities/format/format.functions/format_to_n.verify.cpp libcxx/test/std/utilities/format/format.functions/formatted_size.locale.verify.cpp libcxx/test/std/utilities/format/format.functions/formatted_size.verify.cpp libcxx/test/std/utilities/format/format.functions/unicode.pass.cpp libcxx/test/std/utilities/format/format.range/format.range.fmtstr/format.functions.format.pass.cpp libcxx/test/std/utilities/format/format.range/format.range.fmtstr/format.functions.vformat.pass.cpp libcxx/test/std/utilities/format/format.string/format.string.std/lwg3720_arg_id_width_precision_allowed_types.pass.cpp libcxx/test/std/utilities/format/format.string/format.string.std/lwg3720_arg_id_width_precision_allowed_types.verify.cpp libcxx/test/std/utilities/format/format.tuple/format.functions.format.pass.cpp libcxx/test/std/utilities/format/format.tuple/format.functions.format.verify.cpp libcxx/test/std/utilities/format/format.tuple/format.functions.vformat.pass.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/libcxx/test/libcxx/thread/atomic.availability.verify.cpp b/libcxx/test/libcxx/thread/atomic.availability.verify.cpp
index 3f413fa99b..19204fd8e6 100644
--- a/libcxx/test/libcxx/thread/atomic.availability.verify.cpp
+++ b/libcxx/test/libcxx/thread/atomic.availability.verify.cpp
@@ -19,30 +19,30 @@ void f() {
std::atomic<int> i(3);
std::memory_order m = std::memory_order_relaxed;
- i.wait(4); // expected-warning {{'wait' is only available on}}
- i.wait(4, m); // expected-warning {{'wait' is only available on}}
+ i.wait(4); // expected-warning {{'wait' is only available on}}
+ i.wait(4, m); // expected-warning {{'wait' is only available on}}
i.notify_one(); // expected-warning {{'notify_one' is only available on}}
i.notify_all(); // expected-warning {{'notify_all' is only available on}}
- std::atomic_wait(&i, 4); // expected-warning {{'atomic_wait<int>' is only available on}}
+ std::atomic_wait(&i, 4); // expected-warning {{'atomic_wait<int>' is only available on}}
std::atomic_wait_explicit(&i, 4, m); // expected-warning {{'atomic_wait_explicit<int>' is only available on}}
- std::atomic_notify_one(&i); // expected-warning {{'atomic_notify_one<int>' is only available on}}
- std::atomic_notify_all(&i); // expected-warning {{'atomic_notify_all<int>' is only available on}}
+ std::atomic_notify_one(&i); // expected-warning {{'atomic_notify_one<int>' is only available on}}
+ std::atomic_notify_all(&i); // expected-warning {{'atomic_notify_all<int>' is only available on}}
}
{
std::atomic<int> volatile i(3);
std::memory_order m = std::memory_order_relaxed;
- i.wait(4); // expected-warning {{'wait' is only available on}}
- i.wait(4, m); // expected-warning {{'wait' is only available on}}
+ i.wait(4); // expected-warning {{'wait' is only available on}}
+ i.wait(4, m); // expected-warning {{'wait' is only available on}}
i.notify_one(); // expected-warning {{'notify_one' is only available on}}
i.notify_all(); // expected-warning {{'notify_all' is only available on}}
- std::atomic_wait(&i, 4); // expected-warning {{'atomic_wait<int>' is only available on}}
+ std::atomic_wait(&i, 4); // expected-warning {{'atomic_wait<int>' is only available on}}
std::atomic_wait_explicit(&i, 4, m); // expected-warning {{'atomic_wait_explicit<int>' is only available on}}
- std::atomic_notify_one(&i); // expected-warning {{'atomic_notify_one<int>' is only available on}}
- std::atomic_notify_all(&i); // expected-warning {{'atomic_notify_all<int>' is only available on}}
+ std::atomic_notify_one(&i); // expected-warning {{'atomic_notify_one<int>' is only available on}}
+ std::atomic_notify_all(&i); // expected-warning {{'atomic_notify_all<int>' is only available on}}
}
{
@@ -50,13 +50,14 @@ void f() {
bool b = false;
std::memory_order m = std::memory_order_relaxed;
- flag.wait(b); // expected-warning {{'wait' is only available on}}
- flag.wait(b, m); // expected-warning {{'wait' is only available on}}
+ flag.wait(b); // expected-warning {{'wait' is only available on}}
+ flag.wait(b, m); // expected-warning {{'wait' is only available on}}
flag.notify_one(); // expected-warning {{'notify_one' is only available on}}
flag.notify_all(); // expected-warning {{'notify_all' is only available on}}
std::atomic_flag_wait(&flag, b); // expected-warning {{'atomic_flag_wait' is only available on}}
- std::atomic_flag_wait_explicit(&flag, b, m); // expected-warning {{'atomic_flag_wait_explicit' is only available on}}
+ std::atomic_flag_wait_explicit(
+ &flag, b, m); // expected-warning {{'atomic_flag_wait_explicit' is only available on}}
std::atomic_flag_notify_one(&flag); // expected-warning {{'atomic_flag_notify_one' is only available on}}
std::atomic_flag_notify_all(&flag); // expected-warning {{'atomic_flag_notify_all' is only available on}}
}
@@ -66,13 +67,14 @@ void f() {
bool b = false;
std::memory_order m = std::memory_order_relaxed;
- flag.wait(b); // expected-warning {{'wait' is only available on}}
- flag.wait(b, m); // expected-warning {{'wait' is only available on}}
+ flag.wait(b); // expected-warning {{'wait' is only available on}}
+ flag.wait(b, m); // expected-warning {{'wait' is only available on}}
flag.notify_one(); // expected-warning {{'notify_one' is only available on}}
flag.notify_all(); // expected-warning {{'notify_all' is only available on}}
std::atomic_flag_wait(&flag, b); // expected-warning {{'atomic_flag_wait' is only available on}}
- std::atomic_flag_wait_explicit(&flag, b, m); // expected-warning {{'atomic_flag_wait_explicit' is only available on}}
+ std::atomic_flag_wait_explicit(
+ &flag, b, m); // expected-warning {{'atomic_flag_wait_explicit' is only available on}}
std::atomic_flag_notify_one(&flag); // expected-warning {{'atomic_flag_notify_one' is only available on}}
std::atomic_flag_notify_all(&flag); // expected-warning {{'atomic_flag_notify_all' is only available on}}
}
diff --git a/libcxx/test/libcxx/thread/barrier.availability.verify.cpp b/libcxx/test/libcxx/thread/barrier.availability.verify.cpp
index abe1057a4d..3b28444c96 100644
--- a/libcxx/test/libcxx/thread/barrier.availability.verify.cpp
+++ b/libcxx/test/libcxx/thread/barrier.availability.verify.cpp
@@ -21,21 +21,21 @@ struct CompletionF {
void f() {
// Availability markup on std::barrier<>
{
- std::barrier<> b(10);
- auto token = b.arrive(); // expected-warning {{'arrive' is only available on}}
- (void)b.arrive(10); // expected-warning {{'arrive' is only available on}}
- b.wait(std::move(token)); // expected-warning {{'wait' is only available on}}
- b.arrive_and_wait(); // expected-warning {{'arrive_and_wait' is only available on}}
- b.arrive_and_drop(); // expected-warning {{'arrive_and_drop' is only available on}}
+ std::barrier<> b(10);
+ auto token = b.arrive(); // expected-warning {{'arrive' is only available on}}
+ (void)b.arrive(10); // expected-warning {{'arrive' is only available on}}
+ b.wait(std::move(token)); // expected-warning {{'wait' is only available on}}
+ b.arrive_and_wait(); // expected-warning {{'arrive_and_wait' is only available on}}
+ b.arrive_and_drop(); // expected-warning {{'arrive_and_drop' is only available on}}
}
// Availability markup on std::barrier<CompletionF> with non-default CompletionF
{
- std::barrier<CompletionF> b(10);
- auto token = b.arrive(); // expected-warning {{'arrive' is only available on}}
- (void)b.arrive(10); // expected-warning {{'arrive' is only available on}}
- b.wait(std::move(token)); // expected-warning {{'wait' is only available on}}
- b.arrive_and_wait(); // expected-warning {{'arrive_and_wait' is only available on}}
- b.arrive_and_drop(); // expected-warning {{'arrive_and_drop' is only available on}}
+ std::barrier<CompletionF> b(10);
+ auto token = b.arrive(); // expected-warning {{'arrive' is only available on}}
+ (void)b.arrive(10); // expected-warning {{'arrive' is only available on}}
+ b.wait(std::move(token)); // expected-warning {{'wait' is only available on}}
+ b.arrive_and_wait(); // expected-warning {{'arrive_and_wait' is only available on}}
+ b.arrive_and_drop(); // expected-warning {{'arrive_and_drop' is only available on}}
}
}
diff --git a/libcxx/test/libcxx/thread/latch.availability.verify.cpp b/libcxx/test/libcxx/thread/latch.availability.verify.cpp
index 2f3256d74a..b7821dd580 100644
--- a/libcxx/test/libcxx/thread/latch.availability.verify.cpp
+++ b/libcxx/test/libcxx/thread/latch.availability.verify.cpp
@@ -15,9 +15,9 @@
void f() {
std::latch latch(10);
- latch.count_down(); // expected-warning {{'count_down' is only available on}}
- latch.count_down(3); // expected-warning {{'count_down' is only available on}}
- latch.wait(); // expected-warning {{'wait' is only available on}}
- latch.arrive_and_wait(); // expected-warning {{'arrive_and_wait' is only available on}}
+ latch.count_down(); // expected-warning {{'count_down' is only available on}}
+ latch.count_down(3); // expected-warning {{'count_down' is only available on}}
+ latch.wait(); // expected-warning {{'wait' is only available on}}
+ latch.arrive_and_wait(); // expected-warning {{'arrive_and_wait' is only available on}}
latch.arrive_and_wait(3); // expected-warning {{'arrive_and_wait' is only available on}}
}
diff --git a/libcxx/test/libcxx/thread/semaphore.availability.verify.cpp b/libcxx/test/libcxx/thread/semaphore.availability.verify.cpp
index 94f54324cc..36bccd62a0 100644
--- a/libcxx/test/libcxx/thread/semaphore.availability.verify.cpp
+++ b/libcxx/test/libcxx/thread/semaphore.availability.verify.cpp
@@ -18,31 +18,37 @@ void f() {
{
// Tests for std::counting_semaphore with non-default template argument
std::counting_semaphore<20> sem(10);
- sem.release(); // expected-warning {{'release' is only available on}}
+ sem.release(); // expected-warning {{'release' is only available on}}
sem.release(5); // expected-warning {{'release' is only available on}}
- sem.acquire(); // expected-warning {{'acquire' is only available on}}
- sem.try_acquire_for(std::chrono::milliseconds{3}); // expected-warning-re {{'try_acquire_for<{{.+}}>' is only available on}}
- sem.try_acquire(); // expected-warning {{'try_acquire' is only available on}}
- sem.try_acquire_until(std::chrono::steady_clock::now()); // expected-warning-re {{'try_acquire_until<{{.+}}>' is only available on}}
+ sem.acquire(); // expected-warning {{'acquire' is only available on}}
+ sem.try_acquire_for(
+ std::chrono::milliseconds{3}); // expected-warning-re {{'try_acquire_for<{{.+}}>' is only available on}}
+ sem.try_acquire(); // expected-warning {{'try_acquire' is only available on}}
+ sem.try_acquire_until(std::chrono::steady_clock::
+ now()); // expected-warning-re {{'try_acquire_until<{{.+}}>' is only available on}}
}
{
// Tests for std::counting_semaphore with default template argument
std::counting_semaphore<> sem(10);
- sem.release(); // expected-warning {{'release' is only available on}}
+ sem.release(); // expected-warning {{'release' is only available on}}
sem.release(5); // expected-warning {{'release' is only available on}}
- sem.acquire(); // expected-warning {{'acquire' is only available on}}
- sem.try_acquire_for(std::chrono::milliseconds{3}); // expected-warning-re {{'try_acquire_for<{{.+}}>' is only available on}}
- sem.try_acquire(); // expected-warning {{'try_acquire' is only available on}}
- sem.try_acquire_until(std::chrono::steady_clock::now()); // expected-warning-re {{'try_acquire_until<{{.+}}>' is only available on}}
+ sem.acquire(); // expected-warning {{'acquire' is only available on}}
+ sem.try_acquire_for(
+ std::chrono::milliseconds{3}); // expected-warning-re {{'try_acquire_for<{{.+}}>' is only available on}}
+ sem.try_acquire(); // expected-warning {{'try_acquire' is only available on}}
+ sem.try_acquire_until(std::chrono::steady_clock::
+ now()); // expected-warning-re {{'try_acquire_until<{{.+}}>' is only available on}}
}
{
// Tests for std::binary_semaphore
std::binary_semaphore sem(10);
- sem.release(); // expected-warning {{'release' is only available on}}
+ sem.release(); // expected-warning {{'release' is only available on}}
sem.release(5); // expected-warning {{'release' is only available on}}
- sem.acquire(); // expected-warning {{'acquire' is only available on}}
- sem.try_acquire_for(std::chrono::milliseconds{3}); // expected-warning-re {{'try_acquire_for<{{.+}}>' is only available on}}
- sem.try_acquire(); // expected-warning {{'try_acquire' is only available on}}
- sem.try_acquire_until(std::chrono::steady_clock::now()); // expected-warning-re {{'try_acquire_until<{{.+}}>' is only available on}}
+ sem.acquire(); // expected-warning {{'acquire' is only available on}}
+ sem.try_acquire_for(
+ std::chrono::milliseconds{3}); // expected-warning-re {{'try_acquire_for<{{.+}}>' is only available on}}
+ sem.try_acquire(); // expected-warning {{'try_acquire' is only available on}}
+ sem.try_acquire_until(std::chrono::steady_clock::
+ now()); // expected-warning-re {{'try_acquire_until<{{.+}}>' is only available on}}
}
}
``````````
</details>
https://github.com/llvm/llvm-project/pull/91346
More information about the libcxx-commits
mailing list