]> git.ipfire.org Git - thirdparty/gcc.git/commit
[Ada] Spurious "Duplicated symbol" error with discriminated tasks
authorpmderodat <pmderodat@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 21 Aug 2018 14:46:34 +0000 (14:46 +0000)
committerpmderodat <pmderodat@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 21 Aug 2018 14:46:34 +0000 (14:46 +0000)
commit04d047d8fab8a417d65ce5e2902efcf0798c0838
treecbf64f4e30b3edf5001151630d175f1f3adafefb
parent1ae20fc442f513a8cec0a102b89f7c09f90ea992
[Ada] Spurious "Duplicated symbol" error with discriminated tasks

This patch fixes a spurious error in a program that contains a
discriminated task type and several of its subtype in the same
declarative part, when the corresponding discriminant constraints are
expressions.

2018-08-21  Ed Schonberg  <schonberg@adacore.com>

gcc/ada/

* sem_util.ads, sem_util.adb (New_External_Entity): Type of
Suffix_Index must be Int, not Nat, so that a negative value can
be used to generate a unique name for an external object, as
specified in Tbuild.New_External_Name.
(Scope_Within): Handle private type whose completion is a
synchronized type (For unnesting).
* itypes.ads, itypes.adb (Create_Itype): Ditto
* sem_ch3.adb (Constrain_Corresponding_Record): Generate a
unique name for the created subtype, because there may be
several discriminated tasks present in the same scope, and each
needs its distinct corresponding record subtype.

gcc/testsuite/

* gnat.dg/task1.adb, gnat.dg/task1.ads, gnat.dg/task1_pkg.adb,
gnat.dg/task1_pkg.ads: New testcase.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263716 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ada/ChangeLog
gcc/ada/itypes.adb
gcc/ada/itypes.ads
gcc/ada/sem_ch3.adb
gcc/ada/sem_util.adb
gcc/ada/sem_util.ads
gcc/testsuite/ChangeLog
gcc/testsuite/gnat.dg/task1.adb [new file with mode: 0644]
gcc/testsuite/gnat.dg/task1.ads [new file with mode: 0644]
gcc/testsuite/gnat.dg/task1_pkg.adb [new file with mode: 0644]
gcc/testsuite/gnat.dg/task1_pkg.ads [new file with mode: 0644]