From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3402 invoked by alias); 26 Oct 2012 11:35:42 -0000 Received: (qmail 32580 invoked by uid 48); 26 Oct 2012 11:35:22 -0000 From: "manu at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/55080] New: -pedantic produces error: floating-point literal cannot appear in a constant-expression Date: Fri, 26 Oct 2012 11:35:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Keywords: accepts-invalid X-Bugzilla-Severity: normal X-Bugzilla-Who: manu at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" 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-10/txt/msg02431.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55080 Bug #: 55080 Summary: -pedantic produces error: floating-point literal cannot appear in a constant-expression Classification: Unclassified Product: gcc Version: 4.8.0 Status: UNCONFIRMED Keywords: accepts-invalid Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned@gcc.gnu.org ReportedBy: manu@gcc.gnu.org CC: fang@csl.cornell.edu, manu@gcc.gnu.org, matz@suse.de, papadopo@shfj.cea.fr, rearnsha@gcc.gnu.org, rguenth@gcc.gnu.org, rnewman@compubrite.com Depends on: 11393 Build: any +++ This bug was initially created as a clone of Bug #11393 +++ class B { static const int c = 3.1415926; }; -std=c++98 -pedantic gives error: floating-point literal cannot appear in a constant-expression static const int c = 3.1415926; ^ and -std=c++98 gives nothing. Both -std=c++11 -pedantic and just -std=c++11 report nothing. This is a bug. -pedantic should not produce errors. If this is a GNU extension in c++98 mode, then it should produce a warning like: warning: ISO C++98 forbids using a floating-point literal in a constant-expression [-Wpedantic]