mirror of
https://github.com/dlang/dmd.git
synced 2025-04-26 21:21:48 +03:00
Fix Issue 21699 - Issue 21699 - Duplicate error for index out of bounds at compile time
This commit is contained in:
parent
894db5434c
commit
36e80656e7
2 changed files with 5 additions and 9 deletions
|
@ -1012,7 +1012,7 @@ Expression Expression_optimize(Expression e, int result, bool keepLvalue)
|
|||
if (keepLvalue && ex.op == TOK.arrayLiteral)
|
||||
return;
|
||||
ret = Index(e.type, ex, e.e2).copy();
|
||||
if (CTFEExp.isCantExp(ret) || (keepLvalue && !ret.isLvalue()))
|
||||
if (CTFEExp.isCantExp(ret) || (!ret.isErrorExp() && keepLvalue && !ret.isLvalue()))
|
||||
ret = e;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,14 +1,10 @@
|
|||
/*
|
||||
TEST_OUTPUT:
|
||||
---
|
||||
fail_compilation/test6883.d(19): Error: array index 5 is out of bounds `x[0 .. 5]`
|
||||
fail_compilation/test6883.d(19): Error: array index 5 is out of bounds `x[0 .. 5]`
|
||||
fail_compilation/test6883.d(21): Error: array index 7 is out of bounds `x[0 .. 5]`
|
||||
fail_compilation/test6883.d(21): Error: array index 7 is out of bounds `x[0 .. 5]`
|
||||
fail_compilation/test6883.d(25): Error: array index 5 is out of bounds `x[0 .. 5]`
|
||||
fail_compilation/test6883.d(25): Error: array index 5 is out of bounds `x[0 .. 5]`
|
||||
fail_compilation/test6883.d(27): Error: array index 7 is out of bounds `x[0 .. 5]`
|
||||
fail_compilation/test6883.d(27): Error: array index 7 is out of bounds `x[0 .. 5]`
|
||||
fail_compilation/test6883.d(15): Error: array index 5 is out of bounds `x[0 .. 5]`
|
||||
fail_compilation/test6883.d(17): Error: array index 7 is out of bounds `x[0 .. 5]`
|
||||
fail_compilation/test6883.d(21): Error: array index 5 is out of bounds `x[0 .. 5]`
|
||||
fail_compilation/test6883.d(23): Error: array index 7 is out of bounds `x[0 .. 5]`
|
||||
---
|
||||
*/
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue