This patch fixes the general problem in the detection of potentially unevaluated nested expressions. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sem_util.adb (Immediate_Context_Implies_Is_Potentially_Unevaluated): New subprogram. (Is_Potentially_Unevaluated): Do not stop climbing the tree on the first candidate subexpression; required to handle nested expressions.