* [Ada] Detect unchecked union components with fully qualified names
@ 2021-05-05 8:20 Pierre-Marie de Rodat
0 siblings, 0 replies; only message in thread
From: Pierre-Marie de Rodat @ 2021-05-05 8:20 UTC (permalink / raw)
To: gcc-patches; +Cc: Piotr Trojanek
[-- Attachment #1: Type: text/plain, Size: 274 bytes --]
Unchecked union components were detected only when declared with
unqualified type names.
Tested on x86_64-pc-linux-gnu, committed on trunk
gcc/ada/
* exp_ch4.adb (Component_Is_Unconstrained_UU): Detect both
qualified and unqualified names of unchecked union components.
[-- Attachment #2: patch.diff --]
[-- Type: text/x-diff, Size: 542 bytes --]
diff --git a/gcc/ada/exp_ch4.adb b/gcc/ada/exp_ch4.adb
--- a/gcc/ada/exp_ch4.adb
+++ b/gcc/ada/exp_ch4.adb
@@ -8154,7 +8154,7 @@ package body Exp_Ch4 is
-- Unconstrained nominal type. In the case of a constraint
-- present, the node kind would have been N_Subtype_Indication.
- if Nkind (Sindic) = N_Identifier then
+ if Nkind (Sindic) in N_Expanded_Name | N_Identifier then
return Is_Unchecked_Union (Base_Type (Etype (Sindic)));
end if;
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-05-05 8:20 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-05 8:20 [Ada] Detect unchecked union components with fully qualified names 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).