diff --git a/clang/lib/AST/ASTImporter.cpp b/clang/lib/AST/ASTImporter.cpp index db956561e934..b4c04284055c 100644 --- a/clang/lib/AST/ASTImporter.cpp +++ b/clang/lib/AST/ASTImporter.cpp @@ -1767,6 +1767,9 @@ Error ASTNodeImporter::ImportDefinition( ToData.HasDeclaredCopyAssignmentWithConstParam = FromData.HasDeclaredCopyAssignmentWithConstParam; + // Copy over the data stored in RecordDeclBits + ToCXX->setArgPassingRestrictions(FromCXX->getArgPassingRestrictions()); + SmallVector Bases; for (const auto &Base1 : FromCXX->bases()) { ExpectedType TyOrErr = import(Base1.getType()); diff --git a/clang/test/Import/cxx-record-flags/Inputs/F.cpp b/clang/test/Import/cxx-record-flags/Inputs/F.cpp new file mode 100644 index 000000000000..1294c67f68de --- /dev/null +++ b/clang/test/Import/cxx-record-flags/Inputs/F.cpp @@ -0,0 +1,9 @@ +class FTrivial { + int i; +}; + +struct FNonTrivial { + virtual ~FNonTrivial() = default; + int i; +}; + diff --git a/clang/test/Import/cxx-record-flags/test.cpp b/clang/test/Import/cxx-record-flags/test.cpp new file mode 100644 index 000000000000..bff76274fbac --- /dev/null +++ b/clang/test/Import/cxx-record-flags/test.cpp @@ -0,0 +1,14 @@ +// RUN: clang-import-test -dump-ast -import %S/Inputs/F.cpp -expression %s | FileCheck %s + +// CHECK: FTrivial +// CHECK: DefinitionData +// CHECK-SAME: pass_in_registers + +// CHECK: FNonTrivial +// CHECK-NOT: pass_in_registers +// CHECK: DefaultConstructor + +void expr() { + FTrivial f1; + FNonTrivial f2; +}