<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 moves Java import statements to the wrong location if code contains statements that start with the word import"
   href="https://bugs.llvm.org/show_bug.cgi?id=41187">41187</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>clang-format moves Java import statements to the wrong location if code contains statements that start with the word import
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>8.0
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>All
          </td>
        </tr>

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

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

        <tr>
          <th>Severity</th>
          <td>normal
          </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>fhansen@nevelex.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=21642" name="attach_21642" title="Test file that reproduces the problem">attachment 21642</a> <a href="attachment.cgi?id=21642&action=edit" title="Test file that reproduces the problem">[details]</a></span>
Test file that reproduces the problem

Running 'clang-format -style=LLVM' on

import X;

class C {
  void m() {
    importFile();
  }
}

produces

class C {
  void m() {
    importFile();
import X;
  }
}

It appears that the fact there is a statement that starts with the word import,
in this case importFile, makes clang-format move import statements to
immediately after that statement.

This is a regression in 8.0.0.

Test file attached.</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>