@@ -12591,9 +12591,11 @@ grokparms (tree parmlist, tree *parms)
}
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);
@@ -12609,7 +12611,8 @@ grokparms (tree parmlist, tree *parms)
t = TREE_TYPE (t);
}
if (TREE_CODE (t) == ARRAY_TYPE)
- error (ptr
+ 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 "
new file mode 100644
@@ -0,0 +1,4 @@
+// DR 393
+// { dg-options -Wpedantic }
+
+void f(int (&)[]); // { dg-warning "unknown bound" "" { target c++14_down } }