Why GCC produces -Wreduntant-move here?
Summary The issue at hand is GCC producing a -Wredundant-move warning for a specific function that returns a std::optional. The function uses std::move when returning a std::string object, which seems unnecessary given the presence of a constructor in std::optional that takes an rvalue reference. This warning is not produced by MSVC or Clang, adding to … Read more