lundi 27 juin 2016

Why gcc doesn't recognize initialization like "unsigned int()" for C++11?

int main()
{
    auto k = int();//ok
    auto i = unsigned int();//gcc error
    return 0;
}

The line of "auto i" leads to gcc reporint an eror:

error: expected primary-expression before 'unsigned'

While VC doesn't have problem on my code. Why is this, is this a bug of gcc or, should it use some extra parences?

Thanks.

Aucun commentaire:

Enregistrer un commentaire