===================================================================
@@ -5809,9 +5809,11 @@ check_initializer (tree decl, tree init, int flags
"member %qD", decl);
if (!explained)
{
- error ("(an out of class initialization is required)");
+ inform (input_location,
+ "(an out of class initialization is required)");
explained = 1;
}
+ return NULL_TREE;
}
return init_code;
===================================================================
@@ -0,0 +1,9 @@
+// PR c++/58609
+// { dg-do compile { target c++11 } }
+
+struct A
+{
+ static constexpr int&& i = 0; // { dg-error "initialization" }
+};
+
+int j = A::i;