Skip to content
This repository has been archived by the owner on Jun 20, 2019. It is now read-only.

Commit

Permalink
Bug 133 - ICE: Appending a delegate to an array
Browse files Browse the repository at this point in the history
  • Loading branch information
ibuclaw committed Jun 14, 2014
1 parent ccfb889 commit 6090d4b
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
2 changes: 2 additions & 0 deletions gcc/d/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
2014-06-14 Iain Buclaw <ibuclaw@gdcproject.org>

* d-codegen.h(d_types_compatible): First check equality of types, then
implicit compatibility.
* d-convert.cc(d_default_conversion): Remove function, fold
implementation into...
(d_truthvalue_conversion): ... here.
Expand Down
3 changes: 2 additions & 1 deletion gcc/d/d-codegen.h
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,8 @@ d_types_same (Type *t1, Type *t2)
inline bool
d_types_compatible (Type *t1, Type *t2)
{
return t1->implicitConvTo (t2) >= MATCHconst;
return t1->equals(t2)
|| t1->implicitConvTo (t2) >= MATCHconst;
}

// Returns D Frontend type for GCC type T.
Expand Down
12 changes: 12 additions & 0 deletions gcc/testsuite/gdc.test/runnable/gdc.d
Original file line number Diff line number Diff line change
Expand Up @@ -632,6 +632,18 @@ int[0] test127a; // OK
int[1][0] test127b; // OK
int[0][1] test127c; // ICE

/******************************************/

// Bug 133

void delegate()[] D133;

void test133(void delegate() dg)
{
D133 ~= dg;
}


/******************************************/

void main()
Expand Down

0 comments on commit 6090d4b

Please sign in to comment.