79452810

Date: 2025-02-19 21:24:50
Score: 0.5
Natty:
Report link

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.

Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Vladislav Kogan