public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [C++ Patch] PR 50258
@ 2011-09-23 14:32 Paolo Carlini
  2011-09-23 16:45 ` Jason Merrill
  0 siblings, 1 reply; 2+ messages in thread
From: Paolo Carlini @ 2011-09-23 14:32 UTC (permalink / raw)
  To: gcc-patches; +Cc: Jason Merrill

[-- Attachment #1: Type: text/plain, Size: 106 bytes --]

Hi,

so this is what I'm finishing testing on x86_64-linux. Ok?

Thanks,
Paolo.

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

[-- Attachment #2: CL_50258 --]
[-- Type: text/plain, Size: 338 bytes --]

/cp
2011-09-23  Paolo Carlini  <paolo.carlini@oracle.com>

	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  <paolo.carlini@oracle.com>

	PR c++/50258
	* g++.dg/cpp0x/constexpr-static8.C: New.


[-- Attachment #3: patch_50258 --]
[-- Type: text/plain, Size: 1190 bytes --]

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 ("%<constexpr%> needed for in-class initialization of static "
-	       "data member %q#D of non-integral type", decl);
+	permerror (input_location,
+		   "%<constexpr%> 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);

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [C++ Patch] PR 50258
  2011-09-23 14:32 [C++ Patch] PR 50258 Paolo Carlini
@ 2011-09-23 16:45 ` Jason Merrill
  0 siblings, 0 replies; 2+ messages in thread
From: Jason Merrill @ 2011-09-23 16:45 UTC (permalink / raw)
  To: Paolo Carlini; +Cc: gcc-patches

OK.

Jason

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-09-23 15:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-23 14:32 [C++ Patch] PR 50258 Paolo Carlini
2011-09-23 16:45 ` Jason Merrill

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).