aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2008-08-05 11:40:19 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2008-08-05 11:40:19 +0200
commitba3fa650377b5a8fcea6a9f2cb01628c0885f910 (patch)
tree1f591f8af9c1510292e9b5dfb7f27511cb9ea326 /gcc
parent628a4180a38c05435b0c5d8e0190e2a6f7e54c38 (diff)
downloadgcc-ba3fa650377b5a8fcea6a9f2cb01628c0885f910.zip
gcc-ba3fa650377b5a8fcea6a9f2cb01628c0885f910.tar.gz
gcc-ba3fa650377b5a8fcea6a9f2cb01628c0885f910.tar.bz2
sem_ch12.adb (Validate_Array_Type_Instance): Only apply complex visibility check on the component type if the simple test fails.
2008-08-05 Ed Schonberg <schonberg@adacore.com> * sem_ch12.adb (Validate_Array_Type_Instance): Only apply complex visibility check on the component type if the simple test fails. From-SVN: r138697
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/ChangeLog11
-rw-r--r--gcc/ada/sem_ch12.adb16
2 files changed, 24 insertions, 3 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 9a48000..2628ace 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,14 @@
+2008-08-05 Robert Dewar <dewar@adacore.com>
+
+ * sem_ch3.adb: Minor reformatting
+
+ * prj-nmsc.adb: Minor reformatting
+
+2008-08-05 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_ch12.adb (Validate_Array_Type_Instance): Only apply complex
+ visibility check on the component type if the simple test fails.
+
2008-08-05 Jose Ruiz <ruiz@adacore.com>
* init.c (__gnat_install_handler for linux): If we are building the
diff --git a/gcc/ada/sem_ch12.adb b/gcc/ada/sem_ch12.adb
index 147a097..dc23dde 100644
--- a/gcc/ada/sem_ch12.adb
+++ b/gcc/ada/sem_ch12.adb
@@ -9246,10 +9246,20 @@ package body Sem_Ch12 is
Next_Index (I2);
end loop;
- if not Subtypes_Match
- (Find_Actual_Type (Component_Type (A_Gen_T), A_Gen_T),
- Component_Type (Act_T))
+ -- Check matching subtypes. Note that there are complex visibility
+ -- issues when the generic is a child unit and some aspect of the
+ -- generic type is declared in a parent unit of the generic. We do
+ -- the test to handle this special case only after a direct check
+ -- for static matching has failed.
+
+ if Subtypes_Match
+ (Component_Type (A_Gen_T), Component_Type (Act_T))
+ or else Subtypes_Match
+ (Find_Actual_Type (Component_Type (A_Gen_T), A_Gen_T),
+ Component_Type (Act_T))
then
+ null;
+ else
Error_Msg_NE
("component subtype of actual does not match that of formal &",
Actual, Gen_T);