[clang] [AArch64][SME] Add diagnostics to CheckConstexprFunctionDefinition (PR #121777)

Sander de Smalen via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 6 08:15:33 PST 2025


================
@@ -48,3 +48,9 @@ void streaming_compatible_def2(void (*streaming_fn_ptr)(void) __arm_streaming,
 // Also test when call-site is not a function.
 int streaming_decl_ret_int() __arm_streaming;
 int x = streaming_decl_ret_int(); // expected-error {{call to a streaming function requires 'sme'}}
+
+void sme_attrs_lambdas() {
+  [&] __arm_locally_streaming () { return; }();  // expected-error {{function executed in streaming-SVE mode requires 'sme'}}
----------------
sdesmalen-arm wrote:

nit: the function doesn't use anything from the parent's scope.
```suggestion
  [] __arm_locally_streaming () { return; }();  // expected-error {{function executed in streaming-SVE mode requires 'sme'}}
```

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


More information about the cfe-commits mailing list