[clang] [PAC] Add support for __ptrauth type qualifier (PR #100830)

John McCall via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 5 10:25:18 PST 2025


================
@@ -73,7 +73,7 @@ namespace {
       //   value of the expression to the unqualified, non-atomic version of
       //   the named type.
       if (!S.Context.getLangOpts().ObjC && !DestType->isRecordType() &&
-          !DestType->isArrayType()) {
+          !DestType->isArrayType() && !DestType.getPointerAuth()) {
----------------
rjmccall wrote:

We want to treat casting to a `__ptrauth`-qualified type as an error instead of implicitly ignoring the qualifier. It does seem strange that we end up with this special case, though. Do we not have an existing warning about useless top-level qualifiers in cast types, like if you cast to `(const int)`?

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


More information about the cfe-commits mailing list