Given the following program:
#include <cmath>
int main()
{
std::abs(0u) ;
}
gcc and clang disagree on whether this is ill-formed or not, using gcc it builds without error or warning (see it live), while using clang it generates the following error (see it live):
error: call to 'abs' is ambiguous
std::abs(0u) ;
^~~~~~~~
Which result is correct? Should abs(0u) be ambiguous or not?
Aucun commentaire:
Enregistrer un commentaire