[clang] [Clang] Require base element type of `__has_unique_object_representations` to be complete (PR #95432)
Mital Ashok via cfe-commits
cfe-commits at lists.llvm.org
Thu Jun 13 11:30:14 PDT 2024
================
@@ -2791,6 +2791,12 @@ bool ASTContext::hasUniqueObjectRepresentations(
return hasUniqueObjectRepresentations(getBaseElementType(Ty),
CheckIfTriviallyCopyable);
+ if (Ty->isVoidType())
----------------
MitalAshok wrote:
For the new `!Ty->isIncompleteType()` assertion below. Before `void` would go to the `!isTriviallyCopyable` path, this is just a more explicit way of handling `__has_unique_object_representations(void)`. The assertion could also be `assert(Ty->isVoidType() || !Ty->isIncompleteType())` to follow the spec better?
https://github.com/llvm/llvm-project/pull/95432
More information about the cfe-commits
mailing list