<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - clang-format fails to recognise wxT similarly to _T and formats it badly"
   href="https://bugs.llvm.org/show_bug.cgi?id=36643">36643</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>clang-format fails to recognise wxT similarly to _T and formats it badly
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Formatter
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>fuscated@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>djasper@google.com, klimek@google.com, llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=20018" name="attach_20018" title="Patch with a fix">attachment 20018</a> <a href="attachment.cgi?id=20018&action=edit" title="Patch with a fix">[details]</a></span>
Patch with a fix

This file:

$ test_format_wxt.cpp
void test()
{
        wxString s = wxT("test11 test12 test13 test14 test15 test16")
                 wxT("test21 test22 test23 test24 test25 test26");

    wxString s2 = wxT("test11 test12 test13 test14")
                          wxT("test21 test22 test23 test24")
                          wxT("test31 test32 test33 test34")
                          wxT("test41 test42 test43 test44");

        wxString s3 = _T("test11 test12 test13 test14")
                          _T("test21 test22 test23 test24")
                          _T("test31 test32 test33 test34")
                          _T("test41 test42 test43 test44");
}

Is formatted as:
$ clang-format -style=llvm /tmp/test_format_wxt.cpp
void test() {
  wxString s = wxT("test11 test12 test13 test14 test15 test16")
      wxT("test21 test22 test23 test24 test25 test26");

  wxString s2 =
      wxT("test11 test12 test13 test14") wxT("test21 test22 test23 test24")
          wxT("test31 test32 test33 test34") wxT("test41 test42 test43
test44");

  wxString s3 = _T("test11 test12 test13 test14")
                _T("test21 test22 test23 test24")
                _T("test31 test32 test33 test34")
                _T("test41 test42 test43 test44");
}

Which is not too good. Ideally the behaviour for wxT should be the same as for
_T.

See the attached patch for a variant of a fix.</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>