https://bugs.llvm.org/show_bug.cgi?id=37975

            Bug ID: 37975
           Summary: [Formatter/ObjC] Incorrect indentation after indented
                    @optional when doing incremental formatting
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Formatter
          Assignee: unassignedclangb...@nondot.org
          Reporter: joles...@google.com
                CC: djas...@google.com, kli...@google.com,
                    llvm-bugs@lists.llvm.org

Scenario:
1. Let's assume we have a.m file:
@protocol A
 @optional
// comment
- (void)f;
@end
MACRO
2. The comment was changed.
3. We try to do incremental formatting ("clang-format -lines=3:3 a.m")
4. Result:
@protocol A
 @optional
  // comment
 - (void)f;
 @end
 MACRO

Result of running clang-format on the whole file ("clang-format a.m") is
correct:
@protocol A
@optional
// comment
- (void)f;
@end
MACRO

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to