http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50651
Bug #: 50651
Summary: GNAT rejects matching parameter in generic
instantiation as non-matching
Classification: Unclassified
Product: gcc
Version: 4.5.3
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: ada
AssignedTo: [email protected]
ReportedBy: [email protected]
CC: [email protected], [email protected],
[email protected], [email protected],
[email protected]
+++ This bug was initially created as a clone of Bug #22164 +++
-- ARM 15.5.3(7): "The component subtypes of the formal and actual
-- array types shall statically match."
it passes OK in most situations, but fails with 2005 extension and match
checks.
---
generic
type Data is range <>; -- would pass with "Type Data is private" or anything
even less constraint
type Table is array (Positive range <>) of access Data;
package Test is
end Test;
---
with Test;
package Test_2 is
type My_Data is range 0 .. 16#ff#;
type Data_Table is array (Positive range <>) of access My_Data;
package Instance is new Test
(
Data => My_Data,
Table => Data_Table
);
end Test_2;
---
gcc -c -gnatc -g -gnatq -gnatQ test_2.ads
test_2.ads:11:16: component subtype of actual does not match that of formal
"Table"
test_2.ads:11:16: instantiation abandoned