fork download
  1. enum {
  2. A, B, C, COUNT
  3. };
  4. extern const int (&arr)[COUNT];
  5.  
  6. const int (&arr)[COUNT] = (int[]){ -1, -1};
  7.  
  8. int main() {
  9. arr[C];
  10. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:6:42: error: invalid initialization of reference of type ‘const int (&)[3]’ from expression of type ‘int [2]’
prog.cpp: In function ‘int main()’:
prog.cpp:9:10: warning: statement has no effect [-Wunused-value]
stdout
Standard output is empty