Must constexpr expressions be captured by a lambda in C++? : <p>Here is a piece of code that won't compile in MSVC 2015 (ignore the uninitialized value access):</p>

<pre><code>#include &lt;array&gt;
int main() {
    constexpr int x = 5;
    auto func = []() {
        std::array&lt;int, x&gt; arr;
        return arr[0];
    };
    func();
}
</code></pre>

<p>It complains that:</p>

<pre><code>'x' cannot be implicitly captured because no default capture mode has been specified
</code></pre>

<p>But <code>x</code> is a <code>constexpr</code>!  <code>x</code> is known at compile time to be <code>5</code>.  Why does MSVC kick up a fuss about this?  (Is it <em>yet</em> another MSVC bug?)  GCC will happily compile it.</p>
