================
@@ -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())
----------------
cor3ntin wrote:

maybe there is a bug in `Sema::RequireCompleteType`

```diff
 static bool primaryBaseHaseAddressDiscriminatedVTableAuthentication(
     const ASTContext &Context, const CXXRecordDecl *Class) {
-  if (!Class->isPolymorphic())
+  if (Class->isInvalidDecl() || !Class->isPolymorphic())
     return false;
   const CXXRecordDecl *BaseType = Context.baseForVTableAuthentication(Class);
   using AuthAttr = VTablePointerAuthenticationAttr;
diff --git a/clang/lib/Sema/SemaType.cpp b/clang/lib/Sema/SemaType.cpp
index 280b3c92cce1..9c9a071abf18 100644
--- a/clang/lib/Sema/SemaType.cpp
+++ b/clang/lib/Sema/SemaType.cpp
@@ -9231,7 +9231,7 @@ bool Sema::RequireCompleteType(SourceLocation Loc, 
QualType T,
     TD->setCompleteDefinitionRequired();
     Consumer.HandleTagDeclRequiredDefinition(TD);
   }
-  return false;
+  return !T->isIncompleteType();
 }
 
 bool Sema::hasStructuralCompatLayout(Decl *D, Decl *Suggested) {
``` 

Try to see if that change helps.

https://github.com/llvm/llvm-project/pull/164528
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to