Skip to content

Commit 4cb337a

Browse files
committed
[cxx-interop] Generate memberwise initializers for non-C++ types.
Previously, when we checked for `!hasUserDeclaredConstructor` rather than `isAggregate`, we would always generate memberwise initializers for C record types. This updates the isAggregate to be true for non-C++ types so we will generate memberwise initializers for them as well.
1 parent 5774610 commit 4cb337a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/ClangImporter/ImportDecl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3452,7 +3452,7 @@ namespace {
34523452
ctors.push_back(createDefaultConstructor(Impl, result));
34533453
}
34543454

3455-
bool isAggregate = cxxRecordDecl && cxxRecordDecl->isAggregate();
3455+
bool isAggregate = !cxxRecordDecl || cxxRecordDecl->isAggregate();
34563456
if (hasReferenceableFields && hasMemberwiseInitializer && isAggregate) {
34573457
// The default zero initializer suppresses the implicit value
34583458
// constructor that would normally be formed, so we have to add that

0 commit comments

Comments
 (0)