[clang] [clang][Sema] Diagnose passing function pointer to `__builtin_assume_aligned` (PR #153552)

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 14 04:58:22 PDT 2025


https://github.com/AaronBallman requested changes to this pull request.

Thank you for working on this! However, this isn't quite the correct change IMO. GCC diagnoses function pointer to void * conversions in C++ mode in general. Clang does as well: https://godbolt.org/z/jcW718EY6

I think you should be calling `checkBuiltinArgument()` to initialize the parameter. That should go through the usual initialization sequence logic and emit the correct diagnostics in both C++ and C.

Also, the changes should come with a release note in `clang/docs/ReleaseNotes.rst` so users know about the fix.

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


More information about the cfe-commits mailing list