This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 116a. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.

2024-12-19


1197. Constexpr arrays

Section: 7.7  [expr.const]     Status: C++11     Submitter: Jason Merrill     Date: 2010-09-08

[Voted into the WP at the March, 2011 meeting as part of paper N3260.]

The requirement in 7.7 [expr.const] that a constant expression cannot contain

effectively eliminates the use of automatic constexpr arrays such as

    void f() {
       constexpr int ar[] = { 1, 2 };
       constexpr int i = ar[1];
    }

There does not seem to be a problem with this kind of usage.

Proposed resolution (February, 2011):

The proposed resolution will be submitted as a separate document.