Expansion of attributes Input/Output for unchecked unions didn't work, because it looked for a No_Elist where the AST has an empty list. Now we look for a default value of a first discriminant (because the default values must be given either for all or for none of the discrminants). Also, it was wrong to insert an N_Raise_Program_Error as an action and leave the original N_Attribute_Reference node, because Gigi doesn't know how to expand input or output attribute references. Now we rewrite the attribute reference just like a neighbouring code which raises Program_Error with a reason of PE_Stream_Operation_Not_Allowed. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * exp_attr.adb (Expand_N_Attribute_Reference): Fix expansion of attributes Input and Output for unchecked unions. * sem_case.ads: Fix typo "disriminant" and refill comment.