gcc/libphobos
Iain Buclaw a30552af70 d: foreach over a tuple doesn't work on 16-bit targets (PR100999)
Improves semantic passes in the front-end around the `foreach' and
`static foreach' statements to be more resilient to compiling in a
minimal D runtime environment.  Checking of the index type has been
improved as well so now there won't be needless compiler errors when
using 8 or 16-bit integers as index types when the size fits the
expected loop range.

gcc/d/ChangeLog:

	PR d/100999
	* dmd/cond.c (lowerArrayAggregate): Run CTFE interpret on foreach
	input range.
	(createTupleType): Don't generate typeinfo when disabled.
	(lowerNonArrayAggregate): Suppress errors when running type semantic.
	(staticForeachPrepare): Don't run CTFE interpret from here.
	* dmd/dinterpret.c (ctfeInterpret): Add more shortcut cases.
	* dmd/expression.c (Expression::checkPostblit): Don't generate
	typeinfo when type is missing from library.
	* dmd/expressionsem.c (resolvePropertiesX): Remove early error.
	* dmd/statementsem.c (StatementSemanticVisitor::declareVariable):
	Don't override index type.
	(StatementSemanticVisitor::makeTupleForeachBody): Check index type is
	integral and index range fits type size.
	(StatementSemanticVisitor::visit (ForeachStatement*)): Adjust index
	range before testing.

libphobos/ChangeLog:

	PR d/100999
	* src/std/typecons.d (template Proxy): Check for field or property
	functions as the else branch.

gcc/testsuite/ChangeLog:

	PR d/100999
	* gdc.test/compilable/staticforeach.d: Add new tests.
	* gdc.test/fail_compilation/diag16976.d: Likewise.
	* gdc.test/fail_compilation/fail117.d: Likewise.
	* gdc.test/fail_compilation/fail238_m32.d: Likewise.
	* gdc.test/fail_compilation/fail238_m64.d: Likewise.
	* gdc.test/fail_compilation/fail7424b.d: Likewise.
	* gdc.test/fail_compilation/fail7424c.d: Likewise.
	* gdc.test/fail_compilation/fail7424d.d: Likewise.
	* gdc.test/fail_compilation/fail7424e.d: Likewise.
	* gdc.test/fail_compilation/fail7424f.d: Likewise.
	* gdc.test/fail_compilation/fail7424g.d: Likewise.
	* gdc.test/fail_compilation/fail7424h.d: Likewise.
	* gdc.test/fail_compilation/fail7424i.d: Likewise.
	* gdc.test/fail_compilation/fail9766.d: Likewise.
	* gdc.test/fail_compilation/ice9406.d: Likewise.
	* gdc.test/compilable/extra-files/minimal/object.d: New file.
	* gdc.test/compilable/interpret5.d: New test.
	* gdc.test/compilable/minimal3.d: New test.
	* gdc.test/compilable/test21742.d: New test.
	* gdc.test/compilable/test22006.d: New test.
	* gdc.test/fail_compilation/b12504.d: New test.
	* gdc.test/fail_compilation/fail22006.d: New test.
	* gdc.test/fail_compilation/test21927.d: New test.
	* gdc.test/fail_compilation/test21939.d: New test.

(cherry picked from commit 68f46862d3)
2021-06-11 20:32:23 +02:00
..
libdruntime libphobos: Fix static asserts on NetBSD, FreeBSD, DragonFlyBSD 2021-05-13 19:24:56 +02:00
m4 libphobos: Add Thread/Fiber support code for Darwin (PR98058) 2021-04-19 19:27:27 +02:00
src d: foreach over a tuple doesn't work on 16-bit targets (PR100999) 2021-06-11 20:32:23 +02:00
testsuite libphobos: Add Thread/Fiber support code for Darwin (PR98058) 2021-04-19 19:27:27 +02:00
acinclude.m4 Update copyright years. 2021-01-04 10:26:59 +01:00
aclocal.m4
ChangeLog Daily bump. 2021-05-14 00:18:09 +00:00
config.h.in
configure libphobos: Add Thread/Fiber support code for Darwin (PR98058) 2021-04-19 19:27:27 +02:00
configure.ac libphobos: Build runtime library with -ffunction-sections -fdata-sections 2021-04-10 15:02:07 +02:00
configure.tgt Update copyright years. 2021-01-04 10:26:59 +01:00
d_rules.am Update copyright years. 2021-01-04 10:26:59 +01:00
Makefile.am Update copyright years. 2021-01-04 10:26:59 +01:00
Makefile.in libphobos: Build runtime library with -ffunction-sections -fdata-sections 2021-04-10 15:02:07 +02:00
README.gcc

The files in this directory where noted are part of the DRuntime
and Phobos library.

DRuntime is the low-level runtime library backing the D programming
language, hosted at https://github.com/dlang/druntime/.

Phobos is the standard library for the D Programming Language, hosted
at https://github.com/dlang/phobos/.

The following sources and directories are part of DRuntime:
  libdruntime/core/
  libdruntime/gc/
  libdruntime/gcstub/
  libdruntime/object.d
  libdruntime/rt/

The following sources and directories are part of Phobos:
  src/etc/
  src/index.d
  src/std/

To report a bug or look up known issues with the runtime or standard
library please visit the issue tracker at https://issues.dlang.org/.

All changes to either of these libraries should go through the
upstream repository first, then merged back to GCC.