public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug d/94455] New: no [] operator overload for type
@ 2020-04-02 12:57 jakub at gcc dot gnu.org
  2020-04-02 14:32 ` [Bug d/94455] " ibuclaw at gdcproject dot org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: jakub at gcc dot gnu.org @ 2020-04-02 12:57 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94455

            Bug ID: 94455
           Summary: no [] operator overload for type
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: d
          Assignee: ibuclaw at gdcproject dot org
          Reporter: jakub at gcc dot gnu.org
  Target Milestone: ---

The following testcase is rejected by gdc (trunk, or 9.x), while accepted by
dmd 2.089 or ldc 1.18.0 or later (tried on d.godbolt.org).  Though, admittedly
dmd 2.082 or ldc 1.17.0 and earlier also reject it.
import std.stdio;
import std.array;
import std.conv;

int main()
{

  auto w = appender!string;
  // pre-allocate space for at least 10 elements (this avoids costly
reallocations)
  w.reserve(10);
  assert(w.capacity >= 10);

  w.put('a'); // single elements
  w.put("bc"); // multiple elements

  // use the append syntax
  w ~= 'd';
  w ~= "ef";

  writeln(w[]); // "abcdef"

  return 0;
}

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug d/94455] no [] operator overload for type
  2020-04-02 12:57 [Bug d/94455] New: no [] operator overload for type jakub at gcc dot gnu.org
@ 2020-04-02 14:32 ` ibuclaw at gdcproject dot org
  2020-04-19 18:11 ` cvs-commit at gcc dot gnu.org
  2020-04-19 18:14 ` ibuclaw at gdcproject dot org
  2 siblings, 0 replies; 4+ messages in thread
From: ibuclaw at gdcproject dot org @ 2020-04-02 14:32 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94455

--- Comment #1 from Iain Buclaw <ibuclaw at gdcproject dot org> ---
Not compiler, but a missing library feature that was introduced in a more
recent version than what is bundled with gdc.

It could be backported for convenience, but if it can wait until after gcc-10,
then I hope to this time round sync with all master branches in upstream dlang,
and this pr will resolve itself with no further action.

That is assuming there's nothing blocking on introducing the necessary makefile
changes to support a self-hosted D front-end.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug d/94455] no [] operator overload for type
  2020-04-02 12:57 [Bug d/94455] New: no [] operator overload for type jakub at gcc dot gnu.org
  2020-04-02 14:32 ` [Bug d/94455] " ibuclaw at gdcproject dot org
@ 2020-04-19 18:11 ` cvs-commit at gcc dot gnu.org
  2020-04-19 18:14 ` ibuclaw at gdcproject dot org
  2 siblings, 0 replies; 4+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-04-19 18:11 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94455

--- Comment #2 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Iain Buclaw <ibuclaw@gcc.gnu.org>:

https://gcc.gnu.org/g:3f81d84c9ff84f057628de58ebd009112f9d46f9

commit r10-7804-g3f81d84c9ff84f057628de58ebd009112f9d46f9
Author: Iain Buclaw <ibuclaw@gdcproject.org>
Date:   Sun Apr 19 18:02:17 2020 +0200

    libphobos: Merge upstream phobos bf0d0a37c

    std.array.Appender and RefAppender: use .opSlice() instead of data()

    Previously, Appender.data() was used to extract a slice of the Appender's
array.
    Now use the [] slice operator instead.  The same goes for RefAppender.

    Fixes: PR d/94455

    Reviewed-on: https://github.com/dlang/phobos/pull/7450

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug d/94455] no [] operator overload for type
  2020-04-02 12:57 [Bug d/94455] New: no [] operator overload for type jakub at gcc dot gnu.org
  2020-04-02 14:32 ` [Bug d/94455] " ibuclaw at gdcproject dot org
  2020-04-19 18:11 ` cvs-commit at gcc dot gnu.org
@ 2020-04-19 18:14 ` ibuclaw at gdcproject dot org
  2 siblings, 0 replies; 4+ messages in thread
From: ibuclaw at gdcproject dot org @ 2020-04-19 18:14 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94455

Iain Buclaw <ibuclaw at gdcproject dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|UNCONFIRMED                 |RESOLVED

--- Comment #3 from Iain Buclaw <ibuclaw at gdcproject dot org> ---
There's no dependencies on the change that introduced opSlice for Appender and
RefAppender, backported from upstream phobos to gdc.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-04-19 18:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-02 12:57 [Bug d/94455] New: no [] operator overload for type jakub at gcc dot gnu.org
2020-04-02 14:32 ` [Bug d/94455] " ibuclaw at gdcproject dot org
2020-04-19 18:11 ` cvs-commit at gcc dot gnu.org
2020-04-19 18:14 ` ibuclaw at gdcproject dot org

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).