diff options
author | Ed Schonberg <schonberg@adacore.com> | 2008-08-04 10:38:06 +0200 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2008-08-04 10:38:06 +0200 |
commit | 75bee2700904533693299a7872018705d76671b6 (patch) | |
tree | 307e55c4a678f14ac4990585ef2fd125ffa4657c /gcc | |
parent | 570d3cfb8da442f2dd838e33e8ad3df519712fc5 (diff) | |
download | gcc-75bee2700904533693299a7872018705d76671b6.zip gcc-75bee2700904533693299a7872018705d76671b6.tar.gz gcc-75bee2700904533693299a7872018705d76671b6.tar.bz2 |
sem_prag.adb (Check_Precondition_Postcondition): When scanning the list of declaration to find previous subprogram...
2008-08-04 Ed Schonberg <schonberg@adacore.com>
* sem_prag.adb (Check_Precondition_Postcondition): When scanning the
list of declaration to find previous subprogram, do not go to the
original node of a generic unit.
From-SVN: r138579
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ada/sem_prag.adb | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb index f62d6c8..84fff32 100644 --- a/gcc/ada/sem_prag.adb +++ b/gcc/ada/sem_prag.adb @@ -1425,7 +1425,18 @@ package body Sem_Prag is P := N; while Present (Prev (P)) loop P := Prev (P); - PO := Original_Node (P); + + -- If the previous node is a generic subprogram, do not go to + -- to the original node, which is the unanalyzed tree: we need + -- to attach the pre/postconditions to the analyzed version + -- at this point. They get propagated to the original tree when + -- analyzing the corresponding body. + + if Nkind (P) not in N_Generic_Declaration then + PO := Original_Node (P); + else + PO := P; + end if; -- Skip past prior pragma |