Title
Zero-size arrays in function parameters
Status
tentatively ready
Section
9.3.4.6 [dcl.fct]
Submitter
Jan Schultke

Created on 2025-11-08.00:00:00 last changed yesterday

Messages

Date: 2026-11-14.16:23:02

Proposed resolution (approved by CWG 2026-10-27):

Change in 9.3.4.6 [dcl.fct] paragraph 4 as follows:

...
  void h(int x(const int));  // #3
  void h(int (*)(int)) {}    // defines #3

  void j(int[0]);            // error: int[0] is not a valid type
Date: 2025-11-08.00:00:00

(From submission #797.)

Clarify that a zero-size array as a function parameter is ill-formed, because the array-to-pointer canonicalization happens later. There is implementation divergence.

History
Date User Action Args
2026-11-14 16:23:02adminsetstatus: open -> tentatively ready
2025-11-17 20:44:43adminsetmessages: + msg8385
2025-11-08 00:00:00admincreate