public inbox for gcc-cvs@sourceware.org help / color / mirror / Atom feed
From: Iain Buclaw <ibuclaw@gcc.gnu.org> To: gcc-cvs@gcc.gnu.org Subject: [gcc r12-1345] d: TypeInfo error when using slice copy on Structs (PR100964) Date: Wed, 9 Jun 2021 18:00:29 +0000 (GMT) [thread overview] Message-ID: <20210609180029.5BECF39A2800@sourceware.org> (raw) https://gcc.gnu.org/g:036e14ca44eaddf329a79d56d556862118b1f220 commit r12-1345-g036e14ca44eaddf329a79d56d556862118b1f220 Author: Iain Buclaw <ibuclaw@gdcproject.org> Date: Wed Jun 9 19:39:28 2021 +0200 d: TypeInfo error when using slice copy on Structs (PR100964) 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. Diff: --- gcc/d/dmd/MERGE | 2 +- gcc/d/dmd/expression.c | 7 +++++-- gcc/testsuite/gdc.test/compilable/betterCarray.d | 10 ++++++++++ 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/gcc/d/dmd/MERGE b/gcc/d/dmd/MERGE index e22e3d1ebf7..a617f285eac 100644 --- a/gcc/d/dmd/MERGE +++ b/gcc/d/dmd/MERGE @@ -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. diff --git a/gcc/d/dmd/expression.c b/gcc/d/dmd/expression.c index 2592b38d961..88f13e9669b 100644 --- a/gcc/d/dmd/expression.c +++ b/gcc/d/dmd/expression.c @@ -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) diff --git a/gcc/testsuite/gdc.test/compilable/betterCarray.d b/gcc/testsuite/gdc.test/compilable/betterCarray.d index 74c80be3b95..3f48b042bde 100644 --- a/gcc/testsuite/gdc.test/compilable/betterCarray.d +++ b/gcc/testsuite/gdc.test/compilable/betterCarray.d @@ -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[]; +}
reply other threads:[~2021-06-09 18:00 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20210609180029.5BECF39A2800@sourceware.org \ --to=ibuclaw@gcc.gnu.org \ --cc=gcc-cvs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).