From patchwork Tue Sep 6 08:03:31 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnaud Charlet X-Patchwork-Id: 113503 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 89D63B6F7F for ; Tue, 6 Sep 2011 18:03:53 +1000 (EST) Received: (qmail 6554 invoked by alias); 6 Sep 2011 08:03:48 -0000 Received: (qmail 6543 invoked by uid 22791); 6 Sep 2011 08:03:45 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 06 Sep 2011 08:03:32 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 318D52BB283; Tue, 6 Sep 2011 04:03:31 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id hXdj4sK9cYVl; Tue, 6 Sep 2011 04:03:31 -0400 (EDT) Received: from kwai.gnat.com (kwai.gnat.com [205.232.38.4]) by rock.gnat.com (Postfix) with ESMTP id 206232BB280; Tue, 6 Sep 2011 04:03:31 -0400 (EDT) Received: by kwai.gnat.com (Postfix, from userid 4192) id 21B6D3FEE8; Tue, 6 Sep 2011 04:03:31 -0400 (EDT) Date: Tue, 6 Sep 2011 04:03:31 -0400 From: Arnaud Charlet To: gcc-patches@gcc.gnu.org Cc: Gary Dismukes Subject: [Ada] Protected extension as full type for limited private rejected Message-ID: <20110906080331.GA30297@adacore.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org The compiler complains when a limited private type has a full type that is a protected type extending an interface, thinking that the partial view is not limited. The compiler was incorrectly checking that the partial view satisfies Is_Limited_Composite rather than simply testing for limitedness. The following test must compile quietly with -gnat05: package Priv_Prot_Extension_Bug is type Protected_Interface is protected interface; type Priv is limited private; private protected type Priv is new Protected_Interface with end Priv; end Priv_Prot_Extension_Bug; package body Priv_Prot_Extension_Bug is protected body Priv is end Priv; end Priv_Prot_Extension_Bug; Tested on x86_64-pc-linux-gnu, committed on trunk 2011-09-06 Gary Dismukes * sem_ch9.adb (Check_Interfaces): Test Is_Limited_Type rather than Is_Limited_Record when checking that the partial view of a synchronized full view must be limited. Index: sem_ch9.adb =================================================================== --- sem_ch9.adb (revision 178565) +++ sem_ch9.adb (working copy) @@ -2381,7 +2381,7 @@ -- declaration must be limited. if Present (Interface_List (N)) - and then not Is_Limited_Record (Priv_T) + and then not Is_Limited_Type (Priv_T) then Error_Msg_Sloc := Sloc (Priv_T); Error_Msg_N ("(Ada 2005) limited type declaration expected for " &