From bf421bdcd1b51508036b95000591d24c67e9757c Mon Sep 17 00:00:00 2001 From: kai Date: Sun, 30 Jun 2013 22:31:53 +0200 Subject: [PATCH] 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. --- dmd2/mtype.c | 7 +++++++ dmd2/mtype.h | 3 +++ tests/d2/dmd-testsuite | 2 +- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/dmd2/mtype.c b/dmd2/mtype.c index eefbaa30..e7747c40 100644 --- a/dmd2/mtype.c +++ b/dmd2/mtype.c @@ -3558,6 +3558,13 @@ Expression *TypeVector::defaultInit(Loc loc) return basetype->defaultInit(loc); } +#if IN_LLVM +Expression *TypeVector::defaultInitLiteral(Loc loc) +{ + return basetype->defaultInitLiteral(loc); +} +#endif + int TypeVector::isZeroInit(Loc loc) { return basetype->isZeroInit(loc); diff --git a/dmd2/mtype.h b/dmd2/mtype.h index 6d2918d4..3c34827b 100644 --- a/dmd2/mtype.h +++ b/dmd2/mtype.h @@ -482,6 +482,9 @@ struct TypeVector : Type int checkBoolean(); MATCH implicitConvTo(Type *to); Expression *defaultInit(Loc loc); +#if IN_LLVM + Expression *defaultInitLiteral(Loc loc); +#endif TypeBasic *elementType(); int isZeroInit(Loc loc); TypeInfoDeclaration *getTypeInfoDeclaration(); diff --git a/tests/d2/dmd-testsuite b/tests/d2/dmd-testsuite index dbb7b9fa..30adf906 160000 --- a/tests/d2/dmd-testsuite +++ b/tests/d2/dmd-testsuite @@ -1 +1 @@ -Subproject commit dbb7b9fa186c46576fadf195d8da9117ee988a52 +Subproject commit 30adf9062bbc7a128e78fa7067aa419d8d2341a5