[Ada] Do not force Part_Of on generic units
authorYannick Moy <moy@adacore.com>
Mon, 11 Jun 2018 09:18:01 +0000 (09:18 +0000)
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>
Mon, 11 Jun 2018 09:18:01 +0000 (09:18 +0000)
commitd05bdd90e646234d08ceb855f9b4ae06896f4337
treed7a6b30d80bf275e88483ae67d9eca7601cd65b8
parent270c6b4d6f9300f36cb7e06594d71a62ab59af0a
[Ada] Do not force Part_Of on generic units

This fixes the code checking SPARK RM 7.2.6(3) so that generic child units
are not forced to use Part_Of to relate their abstract state to the state
of their parent.

2018-06-11  Yannick Moy  <moy@adacore.com>

gcc/ada/

* sem_prag.adb (Analyze_Part_Of): Only allow Part_Of on non-generic
unit.
(Check_Missing_Part_Of): Do not force Part_Of on generic unit.

gcc/testsuite/

* gnat.dg/part_of1-instantiation.adb,
gnat.dg/part_of1-instantiation.ads,
gnat.dg/part_of1-private_generic.adb,
gnat.dg/part_of1-private_generic.ads, gnat.dg/part_of1.ads: New
testcase.

From-SVN: r261412
gcc/ada/ChangeLog
gcc/ada/sem_prag.adb
gcc/testsuite/ChangeLog
gcc/testsuite/gnat.dg/part_of1-instantiation.adb [new file with mode: 0644]
gcc/testsuite/gnat.dg/part_of1-instantiation.ads [new file with mode: 0644]
gcc/testsuite/gnat.dg/part_of1-private_generic.adb [new file with mode: 0644]
gcc/testsuite/gnat.dg/part_of1-private_generic.ads [new file with mode: 0644]
gcc/testsuite/gnat.dg/part_of1.ads [new file with mode: 0644]