[all-commits] [llvm/llvm-project] 83d377: [Clang][AArch64] Remove unwarranted 'cannot be use...

Sander de Smalen via All-commits all-commits at lists.llvm.org
Wed Jul 30 07:34:46 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 83d3770d73fa6bd0b04228611b979bfa006a7b93
      https://github.com/llvm/llvm-project/commit/83d3770d73fa6bd0b04228611b979bfa006a7b93
  Author: Sander de Smalen <sander.desmalen at arm.com>
  Date:   2025-07-30 (Wed, 30 Jul 2025)

  Changed paths:
    M clang/lib/Sema/Sema.cpp
    A clang/test/Sema/aarch64-sme-attrs-without-sve.cpp

  Log Message:
  -----------
  [Clang][AArch64] Remove unwarranted 'cannot be used in non-streaming mode' diagnostic. (#150592)

Previously Clang would give an unwarranted error on the capture of '&a'
in the function below, even though the parent function and the lambda
are both `__arm_streaming` functions, when the target is compiled with
+sme only.

```
  void test_both_streaming(int32_t *out) __arm_streaming {
    svint32_t a;
    [&a, &out]() __arm_streaming {
      ^
      error: SVE vector type 'svint32_t' (aka '__SVInt32_t') cannot be used in a non-streaming function

      a = svdup_s32(1);
      svst1(svptrue_b32(), out, a);
    }();
  }
```

That seems to happen because when `checkTypeSupport` is called the
`FunctionDecl` context of the lambda isn't yet complete and
`FD->getType()` returns a Null `QualTy`.

This is loosely related to #94976 which removed a `FD->hasBody()` check
in the same place, because `hasBody()` may incorrectly return `false`
when Clang is still processing a function.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list