Title
Zero-argument macros incorrectly specified
Status
drafting
Section
15.6 [cpp.replace]
Submitter
Richard Smith

Created on 2014-09-12.00:00:00 last changed 124 months ago

Messages

Date: 2014-09-12.00:00:00

According to 15.6 [cpp.replace] paragraph 4,

If the identifier-list in the macro definition does not end with an ellipsis, the number of arguments (including those arguments consisting of no preprocessing tokens) in an invocation of a function-like macro shall equal the number of parameters in the macro definition.

That is, a sequence of no preprocessing tokens counts as an argument. That phrasing has problems with zero-argument function-like macros, e.g.,

  #define M()
  M();

M is defined as having no parameters but the invocation has one (empty) argument, which does not match the number of parameters in the definition.

History
Date User Action Args
2014-09-12 00:00:00admincreate