enum { A, B, C, COUNT }; extern const int (&arr)[COUNT]; const int (&arr)[COUNT] = (int[]){ -1, -1}; int main() { arr[C]; }
Standard input is empty
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]
Standard output is empty