# V655. Strings were concatenated but not used. Consider inspecting the expression.

The analyzer has detected a potential error: an unused concatenation of string variables in the code was found. The types of these variables are as follows: std::string, CString, QString, wxString. These expressions most often appear in the code when an assignment operator is missing or as a result of careless code refactoring.

Consider the following sample of incorrect code:

    void Foo(std::string &s1, const std::string &s2)
    {
      s1 + s2;
    }

The code contains a misprint: '+' is written instead of '+='. The code compiles well but is senseless. This is the fixed code:

    void Foo(std::string &s1, const std::string &s2)
    {
      s1 += s2;
    }

This diagnostic is classified as:

CWE-480

You can look at examples of errors detected by the V655 diagnostic.