-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
std::string can't be returned as NULL #44
Comments
Thanks for the report. I can confirm that GCC 12 is going to contain the change (adding libstdc++ maintainer @jwakely). |
The report is correct, constructing a
|
Note this is going to be an error only if |
But it's still undefined in all earlier versions of C++ if that code ever executes! |
You should still fix it! |
In
StringTokenizer::GetNextToken()
inUtilities/StringTokenizer.cpp
the linereturn(NULL);
is not correct as the function returns astd::string
which can't be set toNULL.
.In fact, GCC 12 will give the following error:
Changing the line
return(NULL);
toreturn("");
fixes this.P.S.: I know GCC 12 isn't released yet, but the current stage 3 prerelease already works quite well.
The text was updated successfully, but these errors were encountered: