2011-12-16 Jason Merrill <jason@redhat.com>
+ PR c++/51461
+ * decl.c (check_static_variable_definition): Check COMPLETE_TYPE_P
+ before literal_type_p.
+
PR c++/51331
* class.c (convert_to_base_statically): Just call
build_simple_base_path.
}
else if (!COMPLETE_TYPE_P (type))
{
- error ("%qD has incomplete type", decl);
+ error ("%q#D has incomplete type", decl);
TREE_TYPE (decl) = error_mark_node;
return NULL_TREE;
}
return 0;
else if (cxx_dialect >= cxx0x && !INTEGRAL_OR_ENUMERATION_TYPE_P (type))
{
- if (literal_type_p (type))
+ if (!COMPLETE_TYPE_P (type))
+ error ("in-class initialization of static data member %q#D of "
+ "incomplete type", decl);
+ else if (literal_type_p (type))
permerror (input_location,
"%<constexpr%> needed for in-class initialization of "
"static data member %q#D of non-integral type", decl);
2011-12-16 Jason Merrill <jason@redhat.com>
+ PR c++/51461
+ * g++.dg/init/static4.C: New.
+
+2011-12-16 Jason Merrill <jason@redhat.com>
+
PR c++/51331
* g++.dg/init/value10.C: New.