https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82249
Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords|diagnostic |rejects-valid Priority|P3 |P1 Known to work| |7.2.1 --- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> --- GCC 7 accepts the code. My version of clang rejects it with t.C:5:6: error: constexpr variable 'calc' must be initialized by a constant expression [](auto n, auto dim)noexcept{ return dim; }; ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~