public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "paolo.carlini at oracle dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/50258] [C++0x] -std=gnu++0x should allow in-class initialization of static const floating types without constexpr
Date: Fri, 23 Sep 2011 11:59:00 -0000	[thread overview]
Message-ID: <bug-50258-4-2yrZTmtluW@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-50258-4@http.gcc.gnu.org/bugzilla/>

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50258

--- Comment #2 from Paolo Carlini <paolo.carlini at oracle dot com> 2011-09-23 11:27:49 UTC ---
Jason, what are we going to do about this? For the record, something like the
below would pass the testsuite...

///////////////

Index: cp/decl.c
===================================================================
--- cp/decl.c   (revision 179115)
+++ 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 ("%<constexpr%> needed for in-class initialization of static "
-              "data member %q#D of non-integral type", decl);
+       pedwarn (input_location, OPT_pedantic,
+                "%<constexpr%> needed for in-class initialization of static "
+                "data member %q#D of non-integral type %qT", decl, type);
       else
        error ("in-class initialization of static data member %q#D of "
               "non-literal type", decl);


  parent reply	other threads:[~2011-09-23 11:28 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-01  6:30 [Bug c++/50258] New: " jyasskin at gcc dot gnu.org
2011-09-01 11:51 ` [Bug c++/50258] [C++0x] " redi at gcc dot gnu.org
2011-09-23 11:59 ` paolo.carlini at oracle dot com [this message]
2011-09-23 12:29 ` redi at gcc dot gnu.org
2011-09-23 12:57 ` paolo.carlini at oracle dot com
2011-09-23 13:14 ` jason at gcc dot gnu.org
2011-09-23 13:19 ` paolo.carlini at oracle dot com
2011-09-23 16:38 ` paolo at gcc dot gnu.org
2011-09-23 17:02 ` paolo.carlini at oracle dot com
2011-09-29 10:46 ` bsys.com.ar at gmail dot com
2011-09-29 11:58 ` redi at gcc dot gnu.org
2011-09-29 20:37 ` bsys.com.ar at gmail dot com

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-50258-4-2yrZTmtluW@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).