Skip to content

Commit

Permalink
Merge pull request #2673 from 9rnsr/rev7444
Browse files Browse the repository at this point in the history
[REG2.063] Disable enhancement feature 7444
  • Loading branch information
WalterBright committed Oct 20, 2013
1 parent c922dfc commit d32f639
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 14 deletions.
6 changes: 3 additions & 3 deletions src/expression.c
Expand Up @@ -11780,7 +11780,7 @@ Expression *AssignExp::semantic(Scope *sc)
e2 = new SliceExp(e2->loc, e2, NULL, NULL);
e2 = e2->semantic(sc);
}
else if (global.params.warnings && !global.gag && op == TOKassign &&
else if (0 && global.params.warnings && !global.gag && op == TOKassign &&
e2->op != TOKarrayliteral && e2->op != TOKstring &&
!e2->implicitConvTo(t1))
{ // Disallow sa = da (Converted to sa[] = da[])
Expand Down Expand Up @@ -11910,7 +11910,7 @@ Expression *AssignExp::semantic(Scope *sc)
{
e2->checkPostblit(sc, t2->nextOf());
}
if (global.params.warnings && !global.gag && op == TOKassign &&
if (0 && global.params.warnings && !global.gag && op == TOKassign &&
e2->op != TOKslice && e2->op != TOKassign &&
e2->op != TOKarrayliteral && e2->op != TOKstring &&
!(e2->op == TOKadd || e2->op == TOKmin ||
Expand All @@ -11934,7 +11934,7 @@ Expression *AssignExp::semantic(Scope *sc)
}
else
{
if (global.params.warnings && !global.gag && op == TOKassign &&
if (0 && global.params.warnings && !global.gag && op == TOKassign &&
t1->ty == Tarray && t2->ty == Tsarray &&
e2->op != TOKslice && //e2->op != TOKarrayliteral &&
t2->implicitConvTo(t1))
Expand Down
14 changes: 3 additions & 11 deletions test/fail_compilation/warn7444.d
Expand Up @@ -4,16 +4,7 @@
/*
TEST_OUTPUT:
---
fail_compilation/warn7444.d(30): Warning: explicit element-wise assignment (sa)[] = e is better than sa = e
fail_compilation/warn7444.d(32): Error: cannot implicitly convert expression (e) of type int to int[]
fail_compilation/warn7444.d(37): Warning: explicit element-wise assignment (sa)[] = sa[] is better than sa = sa[]
fail_compilation/warn7444.d(38): Warning: explicit element-wise assignment sa[] = (sa)[] is better than sa[] = sa
fail_compilation/warn7444.d(41): Warning: explicit element-wise assignment (sa)[] = (da)[] is better than sa = da
fail_compilation/warn7444.d(42): Warning: explicit element-wise assignment (sa)[] = da[] is better than sa = da[]
fail_compilation/warn7444.d(43): Warning: explicit element-wise assignment sa[] = (da)[] is better than sa[] = da
fail_compilation/warn7444.d(47): Warning: explicit slice assignment da = (sa)[] is better than da = sa
fail_compilation/warn7444.d(49): Warning: explicit element-wise assignment da[] = (sa)[] is better than da[] = sa
fail_compilation/warn7444.d(54): Warning: explicit element-wise assignment da[] = (da)[] is better than da[] = da
fail_compilation/warn7444.d(23): Error: cannot implicitly convert expression (e) of type int to int[]
---
*/

Expand Down Expand Up @@ -59,14 +50,15 @@ void test7444()
/*
TEST_OUTPUT:
---
fail_compilation/warn7444.d(69): Warning: explicit element-wise assignment (arr)[] = 0 is better than arr = 0
No warning
---
*/

void test10214()
{
bool[1] arr;
arr = 0;
pragma(msg, "No warning");
}

/*
Expand Down

0 comments on commit d32f639

Please sign in to comment.