This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 110b. See for the official list.


2346. Local variables in default arguments

Section:  [dcl.fct.default]     Status: CD5     Submitter: Geoffrey Romer     Date: 2017-04-26

[Adopted as a DR as part of paper P0588R1 at the October, 2018 meeting.]

According to [dcl.fct.default] paragraph 7,

A local variable shall not appear as a potentially-evaluated expression in a default argument.

This prohibits plausible uses of constexpr and static local variables. Presumably this rule should be similar to the one in 11.6 [class.local] paragraph 1, regarding local classes, which applies to odr-use, not potential evaluation, and to variables with automatic storage duration.