[clang] [Clang][NFC] Mark P2552 as implemented. (PR #92007)

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Mon May 13 10:52:30 PDT 2024


================
@@ -0,0 +1,23 @@
+// RUN: %clang_cc1 -x c++ -std=c++11 -triple x86_64-pc-linux -fsyntax-only
+// RUN: %clang_cc1 -x c++ -std=c++11 -triple x86_64-windows-msvc -fsyntax-only
+
+// Check we return non-zero values for supported attributes as per
+// wg21.link/p2552r3.pdf
+static_assert(__has_cpp_attribute(assume));
+
+// The standard does not prescribe a behavior for [[carries_dependency]]
+
+static_assert(__has_cpp_attribute(deprecated));
+static_assert(__has_cpp_attribute(fallthrough));
+static_assert(__has_cpp_attribute(likely));
+static_assert(__has_cpp_attribute(unlikely));
+static_assert(__has_cpp_attribute(maybe_unused));
+static_assert(__has_cpp_attribute(nodiscard));
+static_assert(__has_cpp_attribute(noreturn));
+
+#ifdef _MSC_VER
----------------
AaronBallman wrote:

I think it's more clear to use `-verify=` instead of using `#ifdef` so it's clear that we expect the static assertion to fail in MSVC mode, but I don't insist.

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


More information about the cfe-commits mailing list