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

Created on 2025-11-08.00:00:00 last changed 3 weeks ago

Messages

Date: 2025-11-17.20:44:43

Suggested resolution:

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
2025-11-17 20:44:43adminsetmessages: + msg8385
2025-11-08 00:00:00admincreate