[Ada] Spurious error on private extension with predicate
authorEd Schonberg <schonberg@adacore.com>
Wed, 26 Sep 2018 09:18:52 +0000 (09:18 +0000)
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>
Wed, 26 Sep 2018 09:18:52 +0000 (09:18 +0000)
commit6cd1ee98eaf775b062c90cb1ef0dc777c086afc2
tree48ec6bb21378f378e57d68460d582c5e90fa6fed
parentabbfd69841b2357d242d47abda8d0430269ab829
[Ada] Spurious error on private extension with predicate

This patch fixes a spurious error involving a private extension whose
full view includes a dynamic predicate, when the parent type is itself
private at the point of the predicate check.  The conversion is known to
be legal so no extra conversion checks are required.

2018-09-26  Ed Schonberg  <schonberg@adacore.com>

gcc/ada/

* exp_util.adb (Make_Predicate_Call): Use OK_Convert_To when
applying a predicate check to prevent spurious errors when
private ancestors are involved.

gcc/testsuite/

* gnat.dg/predicate2-containers.ads,
gnat.dg/predicate2-project-name_values.ads,
gnat.dg/predicate2-project-registry-attribute.ads,
gnat.dg/predicate2-project-registry.ads,
gnat.dg/predicate2-project-typ-set.ads,
gnat.dg/predicate2-project-typ.ads,
gnat.dg/predicate2-project.ads,
gnat.dg/predicate2-source_reference.ads, gnat.dg/predicate2.ads,
gnat.dg/predicate2_main.adb: New testcase.

From-SVN: r264626
13 files changed:
gcc/ada/ChangeLog
gcc/ada/exp_util.adb
gcc/testsuite/ChangeLog
gcc/testsuite/gnat.dg/predicate2-containers.ads [new file with mode: 0644]
gcc/testsuite/gnat.dg/predicate2-project-name_values.ads [new file with mode: 0644]
gcc/testsuite/gnat.dg/predicate2-project-registry-attribute.ads [new file with mode: 0644]
gcc/testsuite/gnat.dg/predicate2-project-registry.ads [new file with mode: 0644]
gcc/testsuite/gnat.dg/predicate2-project-typ-set.ads [new file with mode: 0644]
gcc/testsuite/gnat.dg/predicate2-project-typ.ads [new file with mode: 0644]
gcc/testsuite/gnat.dg/predicate2-project.ads [new file with mode: 0644]
gcc/testsuite/gnat.dg/predicate2-source_reference.ads [new file with mode: 0644]
gcc/testsuite/gnat.dg/predicate2.ads [new file with mode: 0644]
gcc/testsuite/gnat.dg/predicate2_main.adb [new file with mode: 0644]