Skip to content

Fix #14533, #14536 FN stlcstrConcat, stlcstrAssignment, stlcstrConstructor#8261

Open
chrchr-github wants to merge 9 commits intodanmar:mainfrom
chrchr-github:chr_14533
Open

Fix #14533, #14536 FN stlcstrConcat, stlcstrAssignment, stlcstrConstructor#8261
chrchr-github wants to merge 9 commits intodanmar:mainfrom
chrchr-github:chr_14533

Conversation

@chrchr-github
Copy link
Collaborator

No description provided.

@chrchr-github chrchr-github changed the title Fix #14533 FN stlcstrConcat with constructor call Fix #14533, #14536 FN stlcstrConcat Feb 25, 2026
@chrchr-github chrchr-github marked this pull request as draft February 26, 2026 08:47
@chrchr-github chrchr-github changed the title Fix #14533, #14536 FN stlcstrConcat Fix #14533, #14536 FN stlcstrConcat, stlcstrAssignment, stlcstrConstructor Feb 26, 2026
@sonarqubecloud
Copy link

{
const QString filter(tr("Library files (*.cfg)"));
const QString path = Path::getPathFromFilename(mFileName.toStdString()).c_str();
const QString path = QString::fromStdString(Path::getPathFromFilename(mFileName.toStdString()));
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have stdStringLike strings in qt.cfg, sfml.cfg and wxwidgets.cfg, which all have conversion functions to/from std::string. So it should be OK to warn if the types don't match. I guess converting e.g. a QString to a wxString is pretty rare.

@chrchr-github chrchr-github marked this pull request as ready for review February 26, 2026 12:19
if (!cstr)
return false;
const Token* strTok = (cstr == tok->astOperand1()) ? tok->astOperand2() : tok->astOperand1();
return strTok->valueType() && strTok->valueType()->container && strTok->valueType()->container->stdStringLike;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gcc does not complain about this weird code:

#include <string>

int main() {
    std::string s;
    auto a = + s.c_str();
    return 0;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants