===================================================================
@@ -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" }
===================================================================
@@ -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);