aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2023-04-10 10:15:59 +0200
committerEric Botcazou <ebotcazou@adacore.com>2023-09-27 10:16:27 +0200
commitc9af18f8677998e407b9f2e7fd977122969735aa (patch)
treed57872b74690ba16c12a7574793bfff5b011abcc /gcc
parent20af068f2141f7418566f6dfe4eda42afac87244 (diff)
downloadgcc-c9af18f8677998e407b9f2e7fd977122969735aa.zip
gcc-c9af18f8677998e407b9f2e7fd977122969735aa.tar.gz
gcc-c9af18f8677998e407b9f2e7fd977122969735aa.tar.bz2
ada: Fix spurious error on imported generic function with precondition
It occurs during the instantiation because the compiler forgets the context of the generic declaration. gcc/ada/ * freeze.adb (Wrap_Imported_Subprogram): Use Copy_Subprogram_Spec in both cases to copy the spec of the subprogram.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/freeze.adb8
1 files changed, 1 insertions, 7 deletions
diff --git a/gcc/ada/freeze.adb b/gcc/ada/freeze.adb
index df3b5ec..c26c59e 100644
--- a/gcc/ada/freeze.adb
+++ b/gcc/ada/freeze.adb
@@ -6066,12 +6066,6 @@ package body Freeze is
then
-- Here we do the wrap
- -- Note on calls to Copy_Separate_Tree. The trees we are copying
- -- here are fully analyzed, but we definitely want fully syntactic
- -- unanalyzed trees in the body we construct, so that the analysis
- -- generates the right visibility, and that is exactly what the
- -- calls to Copy_Separate_Tree give us.
-
Prag := Copy_Import_Pragma;
-- Fix up spec so it is no longer imported and has convention Ada
@@ -6130,7 +6124,7 @@ package body Freeze is
Specification => Copy_Subprogram_Spec (Spec),
Declarations => New_List (
Make_Subprogram_Declaration (Loc,
- Specification => Copy_Separate_Tree (Spec)),
+ Specification => Copy_Subprogram_Spec (Spec)),
Prag),
Handled_Statement_Sequence =>
Make_Handled_Sequence_Of_Statements (Loc,