[Issue 8200] DMD segfault: template aliasing result of map

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Jun 5 18:57:01 PDT 2012


http://d.puremagic.com/issues/show_bug.cgi?id=8200



--- Comment #2 from Kenji Hara <k.hara.pg at gmail.com> 2012-06-05 18:59:01 PDT ---
May reduced test case. In 2.060head, following code compilation doesn't finish.
(segfault doesn't occurs)
Platform: Windows7 64bit

template map(alias fun)
{
  auto map(R)(R r)
  {
    struct Result
    {
      R _input;

    // If remove this ctor, bug disappears
    version(all)
      this(R input)
      {
        _input = input;
      }

    //@property bool empty()
    //{
    //  return _input.empty;
    //}
      @property auto ref front()
      {
        return fun(_input.front);
      }
    //void popFront()
    //{
    //  _input.popFront();
    //}
    }

    return Result(r);
  }
}
struct Range
{
//enum bool empty = true;
  @property int front() { return 0; }
//void popFront() {}
  int dummy = 0;
}
void main()
{
  enum r = map!(a=>a)(Range());
}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list