[clang] nonblocking/nonallocating attributes: 2nd pass caller/callee analysis (PR #99656)

Jon Roelofs via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 24 15:48:15 PDT 2024


================
@@ -0,0 +1,19 @@
+// RUN: %clang_cc1 -fsyntax-only -fblocks -fcxx-exceptions -verify %s
+
+#pragma clang diagnostic ignored "-Wperf-constraint-implies-noexcept"
+
+// Objective-C
+ at interface OCClass
+- (void)method;
+ at end
+
+void nl14(OCClass *oc) [[clang::nonblocking]] {
+	[oc method]; // expected-warning {{'nonblocking' function must not access an ObjC method or property}}
+}
----------------
jroelofs wrote:

I think it should also forbid `super` for the same reason: accessing it would mean going through a message

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


More information about the cfe-commits mailing list