mardi 5 septembre 2017

{c++14 - tuple} g++ works, but clang++ gives "fatal error: recursive template instantiation exceeded"

The following code gives "fatal error: recursive template instantiation exceeded" error when compiling with clang++ (version 3.8.0-2ubuntu4), but does not have any problem with g++ (version (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609).

If the number of elements in the tuple are reduced to 17, then the code compiles with clang++ as well!

#include <tuple>

int main()
{
    auto t = std::make_tuple(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18);

    return EXIT_SUCCESS;
}

What is wrong with the code? Or is it a bug in clang?

Aucun commentaire:

Enregistrer un commentaire