G++ accepts this code because it sees that no temporary object is constructed when calling from main():
std::vector<int> v;
foo(3, v);
But when it detects such an attempt, it generates the same error as Clang. Meanwhile Clang rejects the code as soon as it notices that it's error-prone.