Skip to content

Commit bf421bd

Browse files
committed
Fix for issue #420.
The frontend only creates a scalar literal instead of an array literal in order to initialize a vector field. This commit adds the missing code.
1 parent 67a9391 commit bf421bd

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

Diff for: dmd2/mtype.c

+7
Original file line numberDiff line numberDiff line change
@@ -3558,6 +3558,13 @@ Expression *TypeVector::defaultInit(Loc loc)
35583558
return basetype->defaultInit(loc);
35593559
}
35603560

3561+
#if IN_LLVM
3562+
Expression *TypeVector::defaultInitLiteral(Loc loc)
3563+
{
3564+
return basetype->defaultInitLiteral(loc);
3565+
}
3566+
#endif
3567+
35613568
int TypeVector::isZeroInit(Loc loc)
35623569
{
35633570
return basetype->isZeroInit(loc);

Diff for: dmd2/mtype.h

+3
Original file line numberDiff line numberDiff line change
@@ -482,6 +482,9 @@ struct TypeVector : Type
482482
int checkBoolean();
483483
MATCH implicitConvTo(Type *to);
484484
Expression *defaultInit(Loc loc);
485+
#if IN_LLVM
486+
Expression *defaultInitLiteral(Loc loc);
487+
#endif
485488
TypeBasic *elementType();
486489
int isZeroInit(Loc loc);
487490
TypeInfoDeclaration *getTypeInfoDeclaration();

Diff for: tests/d2/dmd-testsuite

Submodule dmd-testsuite updated 1 file

0 commit comments

Comments
 (0)