[clang] [clang][Sema] Handle alloc_align on all HasFunctionProto declarations (PR #210871)

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 21 07:48:07 PDT 2026


================
@@ -59,3 +59,10 @@ void foo() {
   f<int>(0); // expected-note {{in instantiation of function template specialization 'GH26612::f<int>' requested here}}
 }
 } // namespace GH26612
+
+void test_function_pointer(
+    char *(*member)(char *) __attribute__((alloc_align(1)))); // expected-error {{'alloc_align' attribute argument may only refer to a function parameter of integer type}}
----------------
AaronBallman wrote:

```suggestion
    char *(*member)(char *) __attribute__((alloc_align(1)))); // expected-error {{'alloc_align' attribute argument may only refer to a function parameter of integer type}}
    char * (*another_member)(int) __attribute___((alloc_align(1))); // ok
```

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


More information about the cfe-commits mailing list