<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 crashes on file with UCS-2 LE BOM encoding Assertion failed: getClient() && "DiagnosticClient not set!""
   href="https://bugs.llvm.org/show_bug.cgi?id=33946">33946</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Clang-format crashes on file with UCS-2 LE BOM encoding   Assertion failed: getClient() && "DiagnosticClient not set!"
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>4.0
          </td>
        </tr>

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

        <tr>
          <th>OS</th>
          <td>Windows NT
          </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>jvapen@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=18849" name="attach_18849" title="Reproduction files">attachment 18849</a> <a href="attachment.cgi?id=18849&action=edit" title="Reproduction files">[details]</a></span>
Reproduction files

Found on clang-format 4.0.1 when trying to use on Windows.
A file created via
 clang-format test.cpp > test.formatted.cpp
will be in in UCS-2 LE BOM (according to notepad++) by default on Windows.
(Note that we don't use -i as this touches the file when no formatting needs to
occur)

If we than run:
 clang-format test.formatted.cpp
We get: Assertion failed: getClient() && "DiagnosticClient not set!"


In attachment you can test.cpp (no _clang-format file needed for reproduction),
which crashes the executable when ran as:
 clang-format test.cpp

If converted to UTF-8/Ascii we don't get a crash


Using clang-format version 4.0.1 (tags/RELEASE_401/final)
(from the 64-bit installer)</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>