[clang] [Clang] Fixed invalid virtual copy constructor assertion (PR #124819)

via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 28 10:48:40 PST 2025


https://github.com/vortex73 created https://github.com/llvm/llvm-project/pull/124819

None

>From cee34e7727b0f8b9440b0d687a2da2f0b4734c15 Mon Sep 17 00:00:00 2001
From: Narayan Sreekumar <nsreekumar6 at gmail.com>
Date: Wed, 29 Jan 2025 00:11:23 +0530
Subject: [PATCH] [Clang] Fixed invalid virtual copy constructor assertion

---
 clang/lib/Sema/SemaDeclCXX.cpp | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/clang/lib/Sema/SemaDeclCXX.cpp b/clang/lib/Sema/SemaDeclCXX.cpp
index c5a72cf812ebc9..d935292191ea58 100644
--- a/clang/lib/Sema/SemaDeclCXX.cpp
+++ b/clang/lib/Sema/SemaDeclCXX.cpp
@@ -6697,6 +6697,10 @@ static bool canPassInRegisters(Sema &S, CXXRecordDecl *D,
   if (D->isDependentType() || D->isInvalidDecl())
     return false;
 
+  for (const CXXMethodDecl *MD : D->methods()) {
+    if (MD->isInvalidDecl())
+      return false;
+  }
   // Clang <= 4 used the pre-C++11 rule, which ignores move operations.
   // The PS4 platform ABI follows the behavior of Clang 3.2.
   if (CCK == TargetInfo::CCK_ClangABI4OrPS4)



More information about the cfe-commits mailing list