public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r13-657] [Ada] Fix continuation message without a prior error
@ 2022-05-19 14:08 Pierre-Marie de Rodat
  0 siblings, 0 replies; only message in thread
From: Pierre-Marie de Rodat @ 2022-05-19 14:08 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:eac0a28825a82b914fc319a3827a1b89e577f1b9

commit r13-657-geac0a28825a82b914fc319a3827a1b89e577f1b9
Author: Piotr Trojanek <trojanek@adacore.com>
Date:   Fri Apr 15 10:44:37 2022 +0200

    [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.

Diff:
---
 gcc/ada/sem_ch8.adb | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/gcc/ada/sem_ch8.adb b/gcc/ada/sem_ch8.adb
index 5945bfdf90d..35a9054e4a9 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;


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-05-19 14:08 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-19 14:08 [gcc r13-657] [Ada] Fix continuation message without a prior error Pierre-Marie de Rodat

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).