diff --git a/gcc/ada/exp_ch4.adb b/gcc/ada/exp_ch4.adb
index ca23727399746dda459edcde3b95a3f722e04755..e8fa5a8f3f549d0be0cc1e7d3eeab804781aa1ac 100644
--- 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;