[clang] [clang] Fix behavior of `__is_trivially_relocatable(volatile int)` (PR #77092)

Amirreza Ashouri via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 19 13:07:18 PST 2024


================
@@ -2669,6 +2669,8 @@ bool QualType::isTriviallyRelocatableType(const ASTContext &Context) const {
     return false;
   } else if (const auto *RD = BaseElementType->getAsRecordDecl()) {
     return RD->canPassInRegisters();
+  } else if (BaseElementType.isTriviallyCopyableType(Context)) {
+    return true;
   } else {
     switch (isNonTrivialToPrimitiveDestructiveMove()) {
----------------
AMP999 wrote:

You mean why is `isNonTrivialToPrimitiveDestructiveMove` different from `isTriviallyRelocatable`? I don't know, but I think it has to do with Objective-C, so I left it alone.

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


More information about the cfe-commits mailing list