Issue2247

Title 2247. Lambda capture and variable argument list
Status c++17 Section 8.1.5 [expr.prim.lambda]
Submitter Aaron Ballman

Created on 2016-03-11.00:00:00 by admin, last changed by admin.

Messages
msg6121 (view) Date: 2017-02-15.00:00:00

Proposed resolution (February, 2017):

Change 21.10.1 [cstdarg.syn] paragraph 1 as follows:

The contents of the header <cstdarg> are the same as the C standard library header <stdarg.h>, with the following changes: The restrictions that ISO C places on the second parameter to the va_start() macro in header <stdarg.h> are different in this International Standard. The parameter parmN is the identifier of the rightmost parameter in the variable parameter list of the function definition (the one just before the ... ).223 If the parameter parmN is a pack expansion (17.6.3 [temp.variadic]) or an entity resulting from a lambda capture (8.1.5 [expr.prim.lambda]), the program is ill-formed, no diagnostic required. If the parameter parmN is of a reference type, or of a type that is not compatible with the type that results when passing an argument for which there is no parameter, the behavior is undefined.
msg5848 (view) Date: 2016-12-15.00:00:00

Notes from the December, 2016 teleconference:

Such examples should have undefined behavior; va_start should only be permitted to access the arguments for the current function.

msg5847 (view) Date: 2017-02-15.00:00:00

[Adopted at the February/March, 2017 meeting.]

[Detailed description pending.]

History
Date User Action Args
2018-02-27 00:00:00adminsetstatus: open -> c++17
section: 5.1.5 [expr.prim.lambda] -> 8.1.5 [expr.prim.lambda]
2018-02-27 00:00:00adminsetmessages: + msg6121
2017-02-06 00:00:00adminsetmessages: + msg5848
2016-03-11 00:00:00admincreate