I\'m not a C++ expert, but as far as I know this code should fail due to size not being constant:
size
#include using namespace std;
Even without VLA extensions, the code can compile when the compiler has failed to deduce that the dimension expression is not known at compile-time. It's still UB.