std::string == G4String is ambiguous with the new c++20 comparison rules. Explicitly cast the G4String to std::string to fix this.