public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug ada/38331] New: Illegal program not detected, "=" not predefined for class-wide types, ARM 4.5.2(6) and AI05-71
@ 2008-11-30 15:14 ludovic at ludovic-brenta dot org
2008-11-30 15:17 ` [Bug ada/38331] " ludovic at ludovic-brenta dot org
0 siblings, 1 reply; 2+ messages in thread
From: ludovic at ludovic-brenta dot org @ 2008-11-30 15:14 UTC (permalink / raw)
To: gcc-bugs
generic
type Item (<>) is private;
with function "=" (L, R : Item) return Boolean is <>;
package pak1 is
end pak1;
with pak1;
package pak2 is
type T is tagged null record;
package new_pak1a is new pak1 (Item => T'Class); --OK by AI05-71
package new_pak1b is new pak1 (Item => T'Class, "=" => "="); --ERROR:
package new_pak1c is new pak1 (Item => T'Class, "=" => pak2."="); --ERROR:
end pak2;
The compiler accepts this program; it should reject new_pak1b and new_pak1c
because function "=" (L, R : T'Class) does not exist. The equality operator is
defined only for "specific type T that is not limited, and not an anonymous
access type" (ARM 4.5.2(6)); class-wide types are not "specific" per ARM
3.9(3).
The reason why new_pak1a is legal is because of the special rule in AI05-71
which only applies when _not_ specifying an actual for the generic formal "=".
--
Summary: Illegal program not detected, "=" not predefined for
class-wide types, ARM 4.5.2(6) and AI05-71
Product: gcc
Version: 4.3.0
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=38331
^ permalink raw reply [flat|nested] 2+ messages in thread
* [Bug ada/38331] Illegal program not detected, "=" not predefined for class-wide types, ARM 4.5.2(6) and AI05-71
2008-11-30 15:14 [Bug ada/38331] New: Illegal program not detected, "=" not predefined for class-wide types, ARM 4.5.2(6) and AI05-71 ludovic at ludovic-brenta dot org
@ 2008-11-30 15:17 ` ludovic at ludovic-brenta dot org
0 siblings, 0 replies; 2+ messages in thread
From: ludovic at ludovic-brenta dot org @ 2008-11-30 15:17 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from ludovic at ludovic-brenta dot org 2008-11-30 15:16 -------
*** This bug has been marked as a duplicate of 16094 ***
--
ludovic at ludovic-brenta dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |DUPLICATE
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38331
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-11-30 15:17 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-11-30 15:14 [Bug ada/38331] New: Illegal program not detected, "=" not predefined for class-wide types, ARM 4.5.2(6) and AI05-71 ludovic at ludovic-brenta dot org
2008-11-30 15:17 ` [Bug ada/38331] " 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).