[Ada] Spurious "Duplicated symbol" error with discriminated tasks
authorEd Schonberg <schonberg@adacore.com>
Tue, 21 Aug 2018 14:46:34 +0000 (14:46 +0000)
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>
Tue, 21 Aug 2018 14:46:34 +0000 (14:46 +0000)
commit2e5df2955f9ec8deafeb2978fcb38fb99f2660fd
treecbf64f4e30b3edf5001151630d175f1f3adafefb
parentc4b9b2916ceb22b57d72fee8f775e02a8851d086
[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.

From-SVN: r263716
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]