From patchwork Thu Apr 28 18:14:51 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Carlini X-Patchwork-Id: 93272 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 1B212B6F53 for ; Fri, 29 Apr 2011 04:15:38 +1000 (EST) Received: (qmail 25762 invoked by alias); 28 Apr 2011 18:15:36 -0000 Received: (qmail 25749 invoked by uid 22791); 28 Apr 2011 18:15:35 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE X-Spam-Check-By: sourceware.org Received: from smtp209.alice.it (HELO smtp209.alice.it) (82.57.200.105) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 28 Apr 2011 18:15:20 +0000 Received: from [192.168.1.4] (79.52.194.192) by smtp209.alice.it (8.5.124.08) id 4D498EF3074844FC for gcc-patches@gcc.gnu.org; Thu, 28 Apr 2011 20:15:18 +0200 Message-ID: <4DB9AE9B.70200@oracle.com> Date: Thu, 28 Apr 2011 20:14:51 +0200 From: Paolo Carlini User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.14) Gecko/20110221 SUSE/3.1.8 Thunderbird/3.1.8 MIME-Version: 1.0 To: "gcc-patches@gcc.gnu.org" Subject: [C++ Patch, committed] PR 48798 X-IsSubscribed: yes 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 Hi, I committed the below patchlet, per the exchange with Jason on the audit trail, after having regtested it on x86_64-linux. Thanks, Paolo. //////////////////// /cp 2011-04-28 Paolo Carlini PR c++/48798 * semantics.c (finish_base_specifier): cv-qualified base class is fine, per DR 484. /testsuite 2011-04-28 Paolo Carlini PR c++/48798 * g++.dg/inherit/pr48798.C: New. * g++.old-deja/g++.other/base1.C: Adjust. Index: testsuite/g++.old-deja/g++.other/base1.C =================================================================== --- testsuite/g++.old-deja/g++.other/base1.C (revision 173116) +++ testsuite/g++.old-deja/g++.other/base1.C (working copy) @@ -3,8 +3,7 @@ // Copyright (C) 2000 Free Software Foundation, Inc. // Contributed by Nathan Sidwell 25 Nov 2000 -// We lost information about which base wasn't an aggregate type, plus we -// allowed cv qualifed bases via typedefs. +// We lost information about which base wasn't an aggregate type. typedef int I; typedef int cI; @@ -16,5 +15,5 @@ typedef A pA; struct B : I {}; // { dg-error "" } not an aggregate struct C : cI {}; // { dg-error "" } not an aggregate -struct D : cA {}; // { dg-error "" } cv qualified +struct D : cA {}; // cv-qualified is fine per DR 484 struct E : pA {}; Index: testsuite/g++.dg/inherit/pr48798.C =================================================================== --- testsuite/g++.dg/inherit/pr48798.C (revision 0) +++ testsuite/g++.dg/inherit/pr48798.C (revision 0) @@ -0,0 +1,4 @@ +// PR c++/48798 + +typedef struct A {} const t; +struct B : t {}; Index: cp/semantics.c =================================================================== --- cp/semantics.c (revision 173116) +++ cp/semantics.c (working copy) @@ -2766,7 +2766,8 @@ finish_base_specifier (tree base, tree access, boo { if (cp_type_quals (base) != 0) { - error ("base class %qT has cv qualifiers", base); + /* DR 484: Can a base-specifier name a cv-qualified + class type? */ base = TYPE_MAIN_VARIANT (base); } result = build_tree_list (access, base);