aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPiotr Trojanek <trojanek@adacore.com>2022-04-15 10:44:37 +0200
committerPierre-Marie de Rodat <derodat@adacore.com>2022-05-19 14:05:32 +0000
commiteac0a28825a82b914fc319a3827a1b89e577f1b9 (patch)
tree05200ea2ad82395a01117007ba6afd7f82607128
parentbd6c3f923686bb49e9fb9040781ae89aaf19d9e1 (diff)
downloadgcc-eac0a28825a82b914fc319a3827a1b89e577f1b9.zip
gcc-eac0a28825a82b914fc319a3827a1b89e577f1b9.tar.gz
gcc-eac0a28825a82b914fc319a3827a1b89e577f1b9.tar.bz2
[Ada] Fix continuation message without a prior error
When resolution of an expanded name fails, we call routine Error_Missing_With_Of_Known_Unit which emits an error continuation message (i.e. an error string starting with \\). However, for error continuations to work properly there must be some prior error, because continuation itself doesn't set flags like Serious_Errors_Detected. Without these flags the problematic statement is not marked with Error_Posted, which in turn is needed to prevent cascaded errors. In particular, when unresolved procedure call uses a direct name or an extended name with an unknown prefix, e.g.: Unknown (1, 2, 3); Unknown.Call (1, 2, 3); then the N_Procedure_Call statements are marked with Error_Posted. But when a call uses an extended name with a known prefix we failed to flag the N_Procedure_Call with Error_Posted. Found while improving the robustness of a feature that detects uninitialized scalar objects. gcc/ada/ * sem_ch8.adb (Find_Expanded_Name): Emit a main error message before adding a continuation with the call to Error_Missing_With_Of_Known_Unit.
-rw-r--r--gcc/ada/sem_ch8.adb2
1 files changed, 2 insertions, 0 deletions
diff --git a/gcc/ada/sem_ch8.adb b/gcc/ada/sem_ch8.adb
index 5945bfd..35a9054 100644
--- a/gcc/ada/sem_ch8.adb
+++ b/gcc/ada/sem_ch8.adb
@@ -6995,6 +6995,8 @@ package body Sem_Ch8 is
Standard_Standard)
then
if not Error_Posted (N) then
+ Error_Msg_NE
+ ("& is not a visible entity of&", Prefix (N), Selector);
Error_Missing_With_Of_Known_Unit (Prefix (N));
end if;