diff options
author | Piotr Trojanek <trojanek@adacore.com> | 2022-02-11 10:40:32 +0100 |
---|---|---|
committer | Pierre-Marie de Rodat <derodat@adacore.com> | 2022-05-12 12:38:40 +0000 |
commit | 3707c8feb1b68028d3967f16c9c4b89d86a14488 (patch) | |
tree | b9b8475be4ca771b9e5ee48f015968815a8e2a70 /gcc/ada/atree.adb | |
parent | dff98f76fb246e0a0d02ce13f2160c69168c3dc7 (diff) | |
download | gcc-3707c8feb1b68028d3967f16c9c4b89d86a14488.zip gcc-3707c8feb1b68028d3967f16c9c4b89d86a14488.tar.gz gcc-3707c8feb1b68028d3967f16c9c4b89d86a14488.tar.bz2 |
[Ada] Fix warning about generic subprograms withed but not instantiated
The compiler should warn when a generic subprogram unit is withed but
not instantiated by the current main unit. This warning relies on flag
Is_Instantiated, which was wrongly set when the generic unit was also
withed and instantiated by some other unit.
This change merely reverts a fix done 20 years ago, which worked around
some spurious warning emitted with inlining enabled. Now the
Is_Instantiated flag is set similarly for generic subprograms and
generic packages.
gcc/ada/
* atree.adb, atree.ads: Move WITH clause from spec to body; to
prevent new warnings stopping the bootstrap.
* fmap.adb, fname-sf.adb, libgnat/a-direct.adb,
libgnat/s-bignum.adb: Remove unnecessary WITH clauses; to
prevent new warnings stopping the bootstrap.
* sem_ch12.adb (Analyze_Subprogram_Instantiation): Only set
Is_Instantiated flag when the instance is in the extended main
source unit.
Diffstat (limited to 'gcc/ada/atree.adb')
-rw-r--r-- | gcc/ada/atree.adb | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/gcc/ada/atree.adb b/gcc/ada/atree.adb index bb4c3b4..08e3667 100644 --- a/gcc/ada/atree.adb +++ b/gcc/ada/atree.adb @@ -31,6 +31,7 @@ with Opt; use Opt; with Output; use Output; with Sinfo.Utils; use Sinfo.Utils; with System.Storage_Elements; +with Unchecked_Conversion; package body Atree is |