This is the mail archive of the
gcc-cvs@gcc.gnu.org
mailing list for the GCC project.
r275862 - in /trunk/gcc: ada/ChangeLog ada/exp_...
- From: pmderodat at gcc dot gnu dot org
- To: gcc-cvs at gcc dot gnu dot org
- Date: Wed, 18 Sep 2019 08:33:28 -0000
- Subject: r275862 - in /trunk/gcc: ada/ChangeLog ada/exp_...
Author: pmderodat
Date: Wed Sep 18 08:33:27 2019
New Revision: 275862
URL: https://gcc.gnu.org/viewcvs?rev=275862&root=gcc&view=rev
Log:
[Ada] Crash on aggregate with dscriminant in if-expression as default
This patch fixes a crash on a an aggregate for a discriminated type,
when a component of the aggregate is also a discriminated type
constrained by a discriminant of the enclosing object, and the default
value for the component is a conditional expression that includes
references to that outer discriminant.
2019-09-18 Ed Schonberg <schonberg@adacore.com>
gcc/ada/
* exp_aggr.adb (Expand_Record_Aggregate, Rewrite_Discriminant):
After rewriting a reference to an outer discriminant as a
selected component of the enclosing object, analyze the selected
component to ensure that the entity of the selector name is
properly set. This is necessary when the aggregate appears
within an expression that may have been analyzed already.
gcc/testsuite/
* gnat.dg/discr58.adb: New testcase.
Added:
trunk/gcc/testsuite/gnat.dg/discr58.adb
Modified:
trunk/gcc/ada/ChangeLog
trunk/gcc/ada/exp_aggr.adb
trunk/gcc/testsuite/ChangeLog