diff options
author | Justin Squirek <squirek@adacore.com> | 2018-05-28 08:53:00 +0000 |
---|---|---|
committer | Pierre-Marie de Rodat <pmderodat@gcc.gnu.org> | 2018-05-28 08:53:00 +0000 |
commit | aa76fac75101cd8694cedce1bee6a79f1f465130 (patch) | |
tree | 0c3c851ed4519cebdb529dfb48467417b4fe6bb2 /gcc/ada | |
parent | e740ff85bd5f9924128d67db1bb66b6a0ba23518 (diff) | |
download | gcc-aa76fac75101cd8694cedce1bee6a79f1f465130.zip gcc-aa76fac75101cd8694cedce1bee6a79f1f465130.tar.gz gcc-aa76fac75101cd8694cedce1bee6a79f1f465130.tar.bz2 |
[Ada] Misleading warning on unresolvable package name
This patch fixes an issue whereby the compiler misidentified a package name
containing the name of a standard runtime package as said package - leading to
and improper error message prompting the user to "With" a package already in
scope.
2018-05-28 Justin Squirek <squirek@adacore.com>
gcc/ada/
* sem_ch8.adb (Find_Expanded_Name): Add extra guard to make sure the
misresolved package name is not a case of mistaken identity.
gcc/testsuite/
* gnat.dg/warn15-core-main.adb, gnat.dg/warn15-core.ads,
gnat.dg/warn15-interfaces.ads, gnat.dg/warn15.ads: New testcase.
From-SVN: r260817
Diffstat (limited to 'gcc/ada')
-rw-r--r-- | gcc/ada/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/ada/sem_ch8.adb | 6 |
2 files changed, 10 insertions, 1 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index b1ccf57..10b2c21 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,8 @@ +2018-05-28 Justin Squirek <squirek@adacore.com> + + * sem_ch8.adb (Find_Expanded_Name): Add extra guard to make sure the + misresolved package name is not a case of mistaken identity. + 2018-05-28 Yannick Moy <moy@adacore.com> * sem_res.adb (Resolve_Range): Re-resolve the low bound of a range in diff --git a/gcc/ada/sem_ch8.adb b/gcc/ada/sem_ch8.adb index 382f12d..1716cc4 100644 --- a/gcc/ada/sem_ch8.adb +++ b/gcc/ada/sem_ch8.adb @@ -6336,7 +6336,11 @@ package body Sem_Ch8 is -- If this is a selection from Ada, System or Interfaces, then -- we assume a missing with for the corresponding package. - if Is_Known_Unit (N) then + if Is_Known_Unit (N) + and then not (Present (Entity (Prefix (N))) + and then Scope (Entity (Prefix (N))) /= + Standard_Standard) + then if not Error_Posted (N) then Error_Msg_Node_2 := Selector; Error_Msg_N -- CODEFIX |