Skip to content

Commit 0176a08

Browse files
authored
Windows: Fix build regressions with pure MSVC toolchain (#4802)
While updating & verifying the build-LDC Wiki pages, I've noticed that the recent Objective-C improvements broke the build with VS 2022, complaining about a few: error C7555: use of designated initializers requires at least '/std:c++20'
1 parent dd44cfa commit 0176a08

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

gen/objcgen.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -538,7 +538,7 @@ ObjcClassInfo *ObjCState::getClass(ClassDeclaration *decl) {
538538

539539
// Since we may end up referring to this very quickly
540540
// the name should be assigned ASAP.
541-
classes[decl] = { .decl = decl };
541+
classes[decl] = { /*.decl =*/ decl };
542542
auto classInfo = &classes[decl];
543543

544544
classInfo->table = (LLGlobalVariable *)getClassTable(decl);
@@ -665,7 +665,7 @@ ObjcProtocolInfo *ObjCState::getProtocol(InterfaceDeclaration *decl) {
665665
return &protocols[decl];
666666
}
667667

668-
protocols[decl] = { .decl = decl };
668+
protocols[decl] = { /*.decl =*/ decl };
669669
auto protoInfo = &protocols[decl];
670670

671671
auto name = objcResolveName(decl);
@@ -723,7 +723,7 @@ ObjcMethodInfo *ObjCState::getMethod(FuncDeclaration *decl) {
723723
if (decl->_linkage != LINK::objc)
724724
return nullptr;
725725

726-
methods[decl] = { .decl = decl };
726+
methods[decl] = { /*.decl =*/ decl };
727727
auto methodInfo = &methods[decl];
728728

729729
auto name = objcResolveName(decl);
@@ -775,7 +775,7 @@ ObjcIvarInfo* ObjCState::getIvar(VarDeclaration *decl) {
775775

776776
if (auto klass = decl->parent->isClassDeclaration()) {
777777
auto ivarsym = objcGetIvarSymbol(objcResolveName(decl->parent), objcResolveName(decl));
778-
ivars[decl] = { .decl = decl };
778+
ivars[decl] = { /*.decl =*/ decl };
779779
auto ivarInfo = &ivars[decl];
780780

781781
// Extern classes should generate globals

0 commit comments

Comments
 (0)