This is not standard C++ program. Zero size arrays are not allowed in C & C++. You should use -pedantic-errors
command line option if you are using g++
& clang++
compiler to strictly confirm to the standard & disable any compiler extensions.
See live demo here. Clang++
says
source_file.cpp:7:14: error: zero size arrays are an extension [-Werror,-Wzero-length-array]
int a1 []{};
^
1 error generated.
solved What does this line of code mean