diff options
author | Justin Squirek <squirek@adacore.com> | 2019-07-04 08:06:40 +0000 |
---|---|---|
committer | Pierre-Marie de Rodat <pmderodat@gcc.gnu.org> | 2019-07-04 08:06:40 +0000 |
commit | e3a79ce3c18fc6e1df6176e506095c7f8bac30ab (patch) | |
tree | ab2de7b37038c6ab18d0fd81e13bb870fe02a75f /gcc/ada/sem_disp.adb | |
parent | bdbb2a405541671bb427f6ff2f463a98c62b0a46 (diff) | |
download | gcc-e3a79ce3c18fc6e1df6176e506095c7f8bac30ab.zip gcc-e3a79ce3c18fc6e1df6176e506095c7f8bac30ab.tar.gz gcc-e3a79ce3c18fc6e1df6176e506095c7f8bac30ab.tar.bz2 |
[Ada] Spurious error on incomplete tagged formal parameter
This patch fixes an issue whereby a check for competing controlling
formals led to a spurious dispatching error due to an incomplete type
being used within a subprogram specification.
2019-07-04 Justin Squirek <squirek@adacore.com>
gcc/ada/
* sem_disp.adb (Check_Controlling_Formals): Obtain the full view
before type comparison.
gcc/testsuite/
* gnat.dg/tagged2.adb, gnat.dg/tagged2.ads: New testcase.
From-SVN: r273063
Diffstat (limited to 'gcc/ada/sem_disp.adb')
-rw-r--r-- | gcc/ada/sem_disp.adb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/gcc/ada/sem_disp.adb b/gcc/ada/sem_disp.adb index a2f753b..92486cd 100644 --- a/gcc/ada/sem_disp.adb +++ b/gcc/ada/sem_disp.adb @@ -210,6 +210,14 @@ package body Sem_Disp is Ctrl_Type := Check_Controlling_Type (Etype (Formal), Subp); if Present (Ctrl_Type) then + -- Obtain the full type in case we are looking at an incomplete + -- view. + + if Ekind (Ctrl_Type) = E_Incomplete_Type + and then Present (Full_View (Ctrl_Type)) + then + Ctrl_Type := Full_View (Ctrl_Type); + end if; -- When controlling type is concurrent and declared within a -- generic or inside an instance use corresponding record type. |