aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/sem_warn.adb11
1 files changed, 11 insertions, 0 deletions
diff --git a/gcc/ada/sem_warn.adb b/gcc/ada/sem_warn.adb
index b5275a8..0be6b39 100644
--- a/gcc/ada/sem_warn.adb
+++ b/gcc/ada/sem_warn.adb
@@ -1523,6 +1523,17 @@ package body Sem_Warn is
-- uninitialized component to get a better message.
elsif Nkind (Parent (UR)) = N_Selected_Component then
+ -- Suppress possibly superfluous warning if component
+ -- is known to exist and is partially initialized.
+
+ if not Has_Discriminants (Etype (E1))
+ and then
+ Is_Partially_Initialized_Type
+ (Etype (Parent (UR)), False)
+ then
+ goto Continue;
+ end if;
+
Error_Msg_Node_2 := Selector_Name (Parent (UR));
if not Comes_From_Source (Parent (UR)) then