Debian Codegraph @

gcc/testsuite/g++.dg/cpp1z/constexpr-array2.C

raw
1 // PR c++/102307
2 // { dg-do compile { target c++11 } }
3
4 #include <array>
5 template <unsigned N, unsigned M> struct Matrix {
6 constexpr Matrix(double const (&arr)[N][M]); // { dg-warning "never defined" }
7 constexpr Matrix(std::array<std::array<double, M>, N> const &arr);
8 };
9 int main() {
10 constexpr Matrix<2, 3>
11 mat {{ {1.0, 2.0, 3.0}, {4.0, 5.0, 6.0} }}; // { dg-error "before its definition" }
12 }