Title
Constexpr arrays
Status
c++11
Section
7.7 [expr.const]
Submitter
Jason Merrill

Created on 2010-09-08.00:00:00 last changed 131 months ago

Messages

Date: 2011-03-15.00:00:00

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

Date: 2011-02-15.00:00:00

Proposed resolution (February, 2011):

The proposed resolution will be submitted as a separate document.

Date: 2010-09-08.00:00:00

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

  • an array-to-pointer conversion (7.3.3 [conv.array]) that is applied to a glvalue that does not designate an object with static storage duration

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.

History
Date User Action Args
2014-03-03 00:00:00adminsetstatus: fdis -> c++11
2011-04-10 00:00:00adminsetmessages: + msg3320
2011-04-10 00:00:00adminsetstatus: tentatively ready -> fdis
2011-02-28 00:00:00adminsetstatus: review -> tentatively ready
2010-11-29 00:00:00adminsetmessages: + msg3080
2010-11-29 00:00:00adminsetstatus: open -> review
2010-09-08 00:00:00admincreate