For warnings about unreferenced entities and unused WITH clauses we typically exclude references outside of the extended main source unit. However, we include references to variables of formal private types to warn in the instance if the corresponding type is not a fully initialized type. This special case was unnecessarily applied to references to other entities of formal private types. In particular, we applied it to the references to generic functions, where the full initialization of the formal private type doesn't matter. As an extreme example, this special case was unnecessarily applied to "pragma Pure (Unchecked_Conversion)" in the runtime unit. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * lib-xref.adb (Generate_Reference): Fix comment and implement it precisely.