Bug ID: 41187
           Summary: clang-format moves Java import statements to the wrong
                    location if code contains statements that start with
                    the word import
           Product: clang
           Version: 8.0
          Hardware: All
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Formatter

Created attachment 21642
Test file that reproduces the problem

Running 'clang-format -style=LLVM' on

import X;

class C {
  void m() {


class C {
  void m() {
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.

You are receiving this mail because:
You are on the CC list for the bug.
llvm-bugs mailing list

Reply via email to