From patchwork Fri Sep 23 13:34:52 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Carlini X-Patchwork-Id: 116076 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 616E8B6F80 for ; Fri, 23 Sep 2011 23:46:32 +1000 (EST) Received: (qmail 13998 invoked by alias); 23 Sep 2011 13:46:24 -0000 Received: (qmail 13989 invoked by uid 22791); 23 Sep 2011 13:46:23 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD, TW_CX X-Spam-Check-By: sourceware.org Received: from acsinet15.oracle.com (HELO acsinet15.oracle.com) (141.146.126.227) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 23 Sep 2011 13:46:05 +0000 Received: from rtcsinet21.oracle.com (rtcsinet21.oracle.com [66.248.204.29]) by acsinet15.oracle.com (Switch-3.4.4/Switch-3.4.4) with ESMTP id p8NDk1fW022134 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 23 Sep 2011 13:46:03 GMT Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156]) by rtcsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id p8NDZmN1016975 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 23 Sep 2011 13:35:48 GMT Received: from abhmt116.oracle.com (abhmt116.oracle.com [141.146.116.68]) by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id p8NDZgCt015208; Fri, 23 Sep 2011 08:35:42 -0500 Received: from [192.168.1.4] (/79.47.193.38) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 23 Sep 2011 06:35:42 -0700 Message-ID: <4E7C8AFC.7040604@oracle.com> Date: Fri, 23 Sep 2011 15:34:52 +0200 From: Paolo Carlini User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:6.0.2) Gecko/20110907 Thunderbird/6.0.2 MIME-Version: 1.0 To: "gcc-patches@gcc.gnu.org" CC: Jason Merrill Subject: [C++ Patch] PR 50258 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, so this is what I'm finishing testing on x86_64-linux. Ok? Thanks, Paolo. //////////////////////// /cp 2011-09-23 Paolo Carlini PR c++/50258 * decl.c (check_static_variable_definition): Allow in-class initialization of static data member of non-integral type in permissive mode. /testsuite 2011-09-23 Paolo Carlini PR c++/50258 * g++.dg/cpp0x/constexpr-static8.C: New. Index: testsuite/g++.dg/cpp0x/constexpr-static8.C =================================================================== --- testsuite/g++.dg/cpp0x/constexpr-static8.C (revision 0) +++ testsuite/g++.dg/cpp0x/constexpr-static8.C (revision 0) @@ -0,0 +1,7 @@ +// PR c++/50258 +// { dg-options "-std=c++0x -fpermissive" } + +struct Foo { + static const double d = 3.14; // { dg-warning "constexpr" } +}; +const double Foo::d; // { dg-warning "constexpr" } Index: cp/decl.c =================================================================== --- cp/decl.c (revision 179116) +++ cp/decl.c (working copy) @@ -7716,8 +7716,9 @@ check_static_variable_definition (tree decl, tree else if (cxx_dialect >= cxx0x && !INTEGRAL_OR_ENUMERATION_TYPE_P (type)) { if (literal_type_p (type)) - error ("% needed for in-class initialization of static " - "data member %q#D of non-integral type", decl); + permerror (input_location, + "% needed for in-class initialization of " + "static data member %q#D of non-integral type", decl); else error ("in-class initialization of static data member %q#D of " "non-literal type", decl);