[clang] [PAC][clang] Correct handling of ptrauth queries of incomplete types (PR #164528)
Oliver Hunt via cfe-commits
cfe-commits at lists.llvm.org
Thu Oct 23 01:13:39 PDT 2025
================
@@ -1618,8 +1618,26 @@ void ASTContext::setRelocationInfoForCXXRecord(
RelocatableClasses.insert({D, Info});
}
+// In future we may want to distinguish the presence or absence of address
+// discrimination, from the inability to determine the presence. For now we rely
+// on all source facing interfaces (type trait queries, etc) diagnosing and
+// reporting an error before reaching these paths.
+static bool canDeterminePointerAuthContent(QualType Type) {
+ if (Type->isIncompleteType() || Type->isDependentType())
+ return false;
+ const TagDecl *Decl = Type->getAsTagDecl();
+ return !Decl || !Decl->getDefinition()->isInvalidDecl();
----------------
ojhunt wrote:
@mizvekov Changing the behavior of isIncompleteType, or changing RequireCompleteType as Corentin tried break all kinds of things everywhere. A lot of it seems to be diagnostics (significant regressions), but there are so many failures I can't be sure there are also actual correctness errors.
https://github.com/llvm/llvm-project/pull/164528
More information about the cfe-commits
mailing list