+2017-07-11 Jason Merrill <jason@redhat.com>
+
+ Core DR 393
+ * decl.c (grokparms): Downgrade error about array of unknown bound
+ to pedwarn and disable it for C++17.
+
2017-07-11 Nathan Sidwell <nathan@acm.org>
* decl2.c (reset_type_linkage_2): Dont't change ctor name.
}
else if (abstract_virtuals_error (decl, type))
any_error = 1; /* Seems like a good idea. */
- else if (POINTER_TYPE_P (type))
+ else if (cxx_dialect < cxx1z
+ && POINTER_TYPE_P (type))
{
- /* [dcl.fct]/6, parameter types cannot contain pointers
+ /* Before C++17 DR 393:
+ [dcl.fct]/6, parameter types cannot contain pointers
(references) to arrays of unknown bound. */
tree t = TREE_TYPE (type);
int ptr = TYPE_PTR_P (type);
t = TREE_TYPE (t);
}
if (TREE_CODE (t) == ARRAY_TYPE)
- error (ptr
- ? G_("parameter %qD includes pointer to array of "
- "unknown bound %qT")
- : G_("parameter %qD includes reference to array of "
- "unknown bound %qT"),
- decl, t);
+ pedwarn (DECL_SOURCE_LOCATION (decl), OPT_Wpedantic,
+ ptr
+ ? G_("parameter %qD includes pointer to array of "
+ "unknown bound %qT")
+ : G_("parameter %qD includes reference to array of "
+ "unknown bound %qT"),
+ decl, t);
}
if (any_error)