This patch fixes a view conflict in an instance, when an equality check against
null involves an operand whose type is private and whose full view is a specific
access type.
Tested on x86_64-pc-linux-gnu, committed on trunk
2011-08-05 Ed Schonberg <[email protected]>
* sem_type.adb (Specific_Type): in an instance, the type-specific
operand of an equality check that involves null may have a private
type. Use full view to determine legality of construct.
Index: sem_type.adb
===================================================================
--- sem_type.adb (revision 177433)
+++ sem_type.adb (working copy)
@@ -3198,6 +3198,17 @@
then
return T1;
+ -- In an instance, the specific type may have a private view. Use full
+ -- view to check legality.
+
+ elsif T2 = Any_Access
+ and then Is_Private_Type (T1)
+ and then Present (Full_View (T1))
+ and then Is_Access_Type (Full_View (T1))
+ and then In_Instance
+ then
+ return T1;
+
elsif T2 = Any_Composite
and then Is_Aggregate_Type (T1)
then