From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19540 invoked by alias); 30 Nov 2008 15:14:02 -0000 Received: (qmail 19459 invoked by uid 48); 30 Nov 2008 15:12:41 -0000 Date: Sun, 30 Nov 2008 15:14:00 -0000 Subject: [Bug ada/38331] New: Illegal program not detected, "=" not predefined for class-wide types, ARM 4.5.2(6) and AI05-71 X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "ludovic at ludovic-brenta dot org" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2008-11/txt/msg02643.txt.bz2 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