From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12734 invoked by alias); 26 Apr 2012 19:43:19 -0000 Received: (qmail 12720 invoked by uid 22791); 26 Apr 2012 19:43:19 -0000 X-SWARE-Spam-Status: No, hits=-4.3 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,KHOP_THREADED X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 26 Apr 2012 19:43:06 +0000 From: "jyasskin at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/52145] [C++11] [DR 903] zero-valued integer constant expression should prefer conversion to pointer Date: Thu, 26 Apr 2012 19:43:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jyasskin at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Status CC Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 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: 2012-04/txt/msg02374.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D52145 Jeffrey Yasskin changed: What |Removed |Added ---------------------------------------------------------------------------- Status|SUSPENDED |NEW CC| |jyasskin at gcc dot gnu.org --- Comment #3 from Jeffrey Yasskin 2012-04-2= 6 19:42:19 UTC --- A simpler test case is: $ cat test.cc const long kNullPtr =3D 0; const long* ptr =3D kNullPtr; $ g++-4.7pre -c test.cc -std=3Dgnu++11 test.cc:2:19: error: invalid conversion from =E2=80=98long int=E2=80=99 to = =E2=80=98const long int*=E2=80=99 [-fpermissive] $ g++-4.7pre --version g++-4.7pre (GCC) 4.7.1 20120412 (prerelease) I'm going to unsuspend this because DR903 is "ready", and gcc-4.7's behavior doesn't match either the proposed wording or the current definition of C++1= 1. The proposed wording discusses a change to C++17 rather than to C++11 (we c= an tell because it adds a "C.3 C++ and ISO C++ 2011" section), so the new error should only show up under -std=3Dgnu++17, and be a warning in -std=3Dgnu++1= 1.