Author
anonymous
over 8 years ago
Language
Compiler
Options
Author
anonymous
over 8 years ago
$ prog.cc:4:19: error: constexpr variable 'i' must be initialized by a constant expression
constexpr int i = a[1][-1];
^ ~~~~~~~~
prog.cc:4:23: note: cannot refer to element -1 of array of 2 elements in a constant expression
constexpr int i = a[1][-1];
^
prog.cc:4:23: warning: array index -1 is before the beginning of the array [-Warray-bounds]
constexpr int i = a[1][-1];
^ ~~
prog.cc:3:5: note: array 'a' declared here
constexpr int a[2][2] = {{1, 2}, {3, 4}};
^
1 warning and 1 error generated.
Exit Code:
1