public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug ada/42412] New: Illegal program accepted, RM 8.5.1(3), renames of classwide object
@ 2009-12-17 19:52 ludovic at ludovic-brenta dot org
2009-12-17 19:53 ` [Bug ada/42412] " ludovic at ludovic-brenta dot org
0 siblings, 1 reply; 2+ messages in thread
From: ludovic at ludovic-brenta dot org @ 2009-12-17 19:52 UTC (permalink / raw)
To: gcc-bugs
package pak1 is
type T1 is tagged null record;
x1: T1;
x2: T1'class := x1;
x3: T1'class renames x1; --ERROR: (detected) T1'class vs T1
x4: T1 renames x2; --ERROR: (missed) T1 vs T1'class
end pak1;
$ gnatmake pak1
gcc-4.3 -c pak1.ads
pak1.ads:5:25: expected type "T1'class" defined at line 2
pak1.ads:5:25: found type "T1" defined at line 2
gnatmake: "pak1.ads" compilation error
RM 8.5.1(3) says "The type of the object_name shall resolve to the
type determined by the subtype_mark." T and T'class are considered
to be different types, and shouldn't match. There is flexibility in
RM 8.6(23) for T'class to sometimes match T, but only when the rules
provide an "expected type". But this flexibility doesn't apply when
the rules say "shall resolve to", as in this case, without giving an
expected type. This subtle wording distinction can also be seen in
other places in the RM, such as 12.4(4) vs. 12.4(5).
--
Summary: Illegal program accepted, RM 8.5.1(3), renames of
classwide object
Product: gcc
Version: 4.3.4
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: ada
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: ludovic at ludovic-brenta dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42412
^ permalink raw reply [flat|nested] 2+ messages in thread
* [Bug ada/42412] Illegal program accepted, RM 8.5.1(3), renames of classwide object
2009-12-17 19:52 [Bug ada/42412] New: Illegal program accepted, RM 8.5.1(3), renames of classwide object ludovic at ludovic-brenta dot org
@ 2009-12-17 19:53 ` ludovic at ludovic-brenta dot org
0 siblings, 0 replies; 2+ messages in thread
From: ludovic at ludovic-brenta dot org @ 2009-12-17 19:53 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from ludovic at ludovic-brenta dot org 2009-12-17 19:52 -------
$ gnatmake pak1
gcc-4.4 -c pak1.ads
pak1.ads:5:25: expected type "T1'class" defined at line 2
pak1.ads:5:25: found type "T1" defined at line 2
pak1.ads:6:19: dynamically tagged expression not allowed
gnatmake: "pak1.ads" compilation error
So the bug is fixed in 4.4.
--
ludovic at ludovic-brenta dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Known to fail| |4.3.4
Known to work| |4.4.2
Resolution| |FIXED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42412
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-12-17 19:53 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-12-17 19:52 [Bug ada/42412] New: Illegal program accepted, RM 8.5.1(3), renames of classwide object ludovic at ludovic-brenta dot org
2009-12-17 19:53 ` [Bug ada/42412] " ludovic at ludovic-brenta dot org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).