Alocação de matriz em C ++ na pilha com comprimento variável [duplicado]

Esta questão já tem uma resposta aqui:

C ++: Por que o array int [size] funciona? 3 respostas

Fiquei surpreso ao descobrir que é possível alocar uma matriz de tamanho variável na pilha em C ++ (comoint array[i];). Parece funcionar bem tanto no clang quanto no gcc (no OS / X), mas o MSVC 2012 não permite isso.

O que é esse recurso de idioma chamado? E é um recurso oficial da linguagem C ++? Se sim, qual versão do C ++?

Exemplo completo:

#include <iostream>

using namespace std;

int sum(int *array, int length){
    int s = 0;
    for (int i=0;i<length;i++){
        s+= array[i];
    }
    return s;
}

int func(int i){
    int array[i]; // <-- This is the feature that I'm talking about
    for (int j=0;j<i;j++){
        array[j] = j;
    }

    return sum(array, i);

}

int main(int argc, const char * argv[])
{
    cout << "Func 1 "<<func(1)<<endl;
    cout << "Func 2 "<<func(2)<<endl;
    cout << "Func 3 "<<func(3)<<endl;

    return 0;
}

questionAnswers(4)

yourAnswerToTheQuestion