From patchwork Mon Jul 7 15:27:07 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Carlini X-Patchwork-Id: 367619 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]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 020F0140086 for ; Tue, 8 Jul 2014 01:31:16 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:subject:content-type; q= dns; s=default; b=csCAGbkhgHRspzu7Ccor+eYLbRTXRRWysbpc17Cejbm42h YoMLnHjtyhc0jf3UOzFAmHeSowS0H6RJ2HxF1cnAodkEvdQHh2JE0KEzVRaYRQAD 2C8sTI1mFMLOfYEWh0xD5jBrCkm1YbeBanfntMRjCjg1kpsE4Sa3hmN6Newgk= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:subject:content-type; s= default; bh=ueThudSuP3GORUVLkv1vPq3CZ/E=; b=qmOf0k4ZAWq1/Xy5Rmf5 8J2ASdNLJ7ykY3lYkVFVoddFOzIAaugV+iI0rCI/rEaDmzr5hIHlau2FZ50g7N3A k8RxXn7h2rh7u8khDrgMNG91kDwsVtVMDcYjBoswSsiYNCObaLBnTGjLXxne3l1y GxJLoJ5ghBhoeJ8jNZ4mhx0= Received: (qmail 22210 invoked by alias); 7 Jul 2014 15:31:08 -0000 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 Received: (qmail 22196 invoked by uid 89); 7 Jul 2014 15:31:07 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.6 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD, SPF_PASS autolearn=ham version=3.3.2 X-HELO: userp1040.oracle.com Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Mon, 07 Jul 2014 15:31:06 +0000 Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id s67FV3Jo005881 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 7 Jul 2014 15:31:04 GMT Received: from userz7021.oracle.com (userz7021.oracle.com [156.151.31.85]) by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id s67FV2sr006057 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL) for ; Mon, 7 Jul 2014 15:31:02 GMT Received: from abhmp0010.oracle.com (abhmp0010.oracle.com [141.146.116.16]) by userz7021.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id s67FV17l015647 for ; Mon, 7 Jul 2014 15:31:01 GMT Received: from [192.168.1.4] (/79.35.233.155) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 07 Jul 2014 08:31:00 -0700 Message-ID: <53BABC4B.4090800@oracle.com> Date: Mon, 07 Jul 2014 17:27:07 +0200 From: Paolo Carlini User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: "gcc-patches@gcc.gnu.org" Subject: [C++ Patch, obvious] Use % and % in error messages X-IsSubscribed: yes Hi, tested x86_64-linux, committed as obvious. Thanks, Paolo. //////////////////// /cp 2014-07-07 Paolo Carlini * class.c (check_for_override): Wrap the 'final' and 'override' keywords in %< and %>. /testsuite 2014-07-07 Paolo Carlini * g++.dg/cpp0x/override1.C: Tweak expected error messages. Index: cp/class.c =================================================================== --- cp/class.c (revision 212330) +++ cp/class.c (working copy) @@ -2771,9 +2771,9 @@ check_for_override (tree decl, tree ctype) TYPE_HAS_NONTRIVIAL_DESTRUCTOR (ctype) = true; } else if (DECL_FINAL_P (decl)) - error ("%q+#D marked final, but is not virtual", decl); + error ("%q+#D marked %, but is not virtual", decl); if (DECL_OVERRIDE_P (decl) && !overrides_found) - error ("%q+#D marked override, but does not override", decl); + error ("%q+#D marked %, but does not override", decl); } /* Warn about hidden virtual functions that are not overridden in t. Index: testsuite/g++.dg/cpp0x/override1.C =================================================================== --- testsuite/g++.dg/cpp0x/override1.C (revision 212330) +++ testsuite/g++.dg/cpp0x/override1.C (working copy) @@ -18,7 +18,7 @@ struct D : B template struct D2 : T { - void h() override {} // { dg-error "marked override, but does not override" } + void h() override {} // { dg-error "marked 'override', but does not override" } }; template struct D3 : T @@ -38,14 +38,14 @@ struct B3 struct B4 { - void f() final {} // { dg-error "marked final, but is not virtual" } + void f() final {} // { dg-error "marked 'final', but is not virtual" } }; struct D5 : B { - void ff() override {} // { dg-error "marked override, but does not override" } - virtual void fff() override {} // { dg-error "marked override, but does not override" } - virtual void x() override {} // { dg-error "marked override, but does not override" } + void ff() override {} // { dg-error "marked 'override', but does not override" } + virtual void fff() override {} // { dg-error "marked 'override', but does not override" } + virtual void x() override {} // { dg-error "marked 'override', but does not override" } void g() override; };