]> git.ipfire.org Git - thirdparty/gcc.git/commit
[Ada] gnatbind -f switch gives an error for duplicates
authorBob Duff <duff@adacore.com>
Thu, 11 Jan 2018 08:53:27 +0000 (08:53 +0000)
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>
Thu, 11 Jan 2018 08:53:27 +0000 (08:53 +0000)
commit8207dc2311d761ddff0de5d0a2e8a72dc4e94e78
tree4d13a7bf55f96da66623be0b4fd18f03959f32f4
parent52c5090a4f940459ac3e38bcee0fd9f5f86a4eff
[Ada] gnatbind -f switch gives an error for duplicates

If the -felab-order.txt switch is given to gnatbind, and there are duplicate
unit names in elab-order.txt, an error will be given.

The following test should get errors:

this (spec) <-- that (body)
error: elab-order.txt:5: duplicate unit name "this (spec)" from line 1
error: elab-order.txt:7: duplicate unit name "that (body)" from line 3
gnatmake: *** bind failed.

Content of elab-order.txt (7 lines):

this%s

that%b

this (spec)

that%b

gnatmake -q -f -g -O0 -gnata that-main.adb -bargs -felab-order.txt

package body That is
end That;
package That is
   pragma Elaborate_Body;
end That;
with This, That;
procedure That.Main is
begin
   null;
end That.Main;
package body This is
end This;
package This is
   pragma Elaborate_Body;
end This;

2018-01-11  Bob Duff  <duff@adacore.com>

gcc/ada/

* binde.adb (Force_Elab_Order): Give an error if there are duplicate
unit names.

From-SVN: r256508
gcc/ada/ChangeLog
gcc/ada/binde.adb