d: TypeInfo error when using slice copy on Structs (PR100964)
authorIain Buclaw <ibuclaw@gdcproject.org>
Wed, 9 Jun 2021 17:39:28 +0000 (19:39 +0200)
committerIain Buclaw <ibuclaw@gdcproject.org>
Wed, 9 Jun 2021 17:41:30 +0000 (19:41 +0200)
Known limitation: does not work for struct with postblit or dtor.

Reviewed-on: https://github.com/dlang/dmd/pull/12648

gcc/d/ChangeLog:

PR d/100964
* dmd/MERGE: Merge upstream dmd 4a4e46a6f.

gcc/d/dmd/MERGE
gcc/d/dmd/expression.c
gcc/testsuite/gdc.test/compilable/betterCarray.d

index e22e3d1..a617f28 100644 (file)
@@ -1,4 +1,4 @@
-f3fdeb578f8cc6d9426d47d2fa144d2078f9ab29
+4a4e46a6f304a667e0c05d4455706ec2056ffddc
 
 The first line of this file holds the git revision number of the last
 merge done from the dlang/dmd repository.
index 2592b38..88f13e9 100644 (file)
@@ -1044,8 +1044,11 @@ bool Expression::checkPostblit(Scope *sc, Type *t)
     t = t->baseElemOf();
     if (t->ty == Tstruct)
     {
-        // Bugzilla 11395: Require TypeInfo generation for array concatenation
-        semanticTypeInfo(sc, t);
+        if (global.params.useTypeInfo)
+        {
+            // Bugzilla 11395: Require TypeInfo generation for array concatenation
+            semanticTypeInfo(sc, t);
+        }
 
         StructDeclaration *sd = ((TypeStruct *)t)->sym;
         if (sd->postblit)
index 74c80be..3f48b04 100644 (file)
@@ -15,3 +15,13 @@ int foo(int[] a, int i)
 {
     return a[i];
 }
+
+/**********************************************/
+// https://issues.dlang.org/show_bug.cgi?id=19234
+void issue19234()
+{
+    static struct A {}
+    A[10] a;
+    A[10] b;
+    b[] = a[];
+}