Skip to content

Add performance-single-char-stream-insert check #26925

@LegalizeAdulthood

Description

@LegalizeAdulthood
Bugzilla Link 26551
Version unspecified
OS All
CC @EugeneZelenko

Extended Description

Add a performance check that looks for string literal insertion into an output stream where the string literal is a single character.

Replace the string literal insertion with a character literal insertion.

Special cases to consider:

str << "'"; => str << ''';
str << """ => str << '"';

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugzillaIssues migrated from bugzillacheck-requestRequest for a new check in clang-tidyclang-tidy

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions