<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 - [Format/ObjC] Incorrect spacing before array subscript operation containing ObjC method call"
   href="https://bugs.llvm.org/show_bug.cgi?id=39412">39412</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[Format/ObjC] Incorrect spacing before array subscript operation containing ObjC method call
          </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>All
          </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>bhamiltoncx@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>clang-format currently incorrectly inserts a space between an identifier and an
array subscript operation when the value of the index is the result of an
Objective-C method call:

% cat /tmp/test.m
foo[[Bar() blech]];

% ./bin/clang-format -debug /tmp/test.m
Args: ./bin/clang-format -debug /tmp/test.m 
Trying /tmp/.clang-format...
Trying /tmp/_clang-format...
Trying /.clang-format...
Trying /_clang-format...
File encoding: UTF8
Language: Objective-C
----
Line(0, FSC=0): identifier[T=68, OC=0] l_square[T=68, OC=3] l_square[T=68,
OC=4] identifier[T=68, OC=5] l_paren[T=68, OC=8] r_paren[T=68, OC=9]
identifier[T=68, OC=11] r_square[T=68, OC=16] r_square[T=68, OC=17] semi[T=68,
OC=18] 
Line(0, FSC=0): eof[T=68, OC=0] 
Run 0...
AnnotatedTokens(L=0):
 M=0 C=0 T=Unknown S=1 B=0 BK=0 P=0 Name=identifier L=3 PPK=2 FakeLParens=
FakeRParens=0 II=0x5610d7887bb0 Text='foo'
 M=0 C=1 T=AttributeSquare S=1 B=0 BK=0 P=23 Name=l_square L=5 PPK=2
FakeLParens= FakeRParens=0 II=0x0 Text='['
 M=0 C=1 T=AttributeSquare S=0 B=0 BK=0 P=59 Name=l_square L=6 PPK=2
FakeLParens= FakeRParens=0 II=0x0 Text='['
 M=0 C=0 T=Unknown S=0 B=0 BK=0 P=79 Name=identifier L=9 PPK=2 FakeLParens=
FakeRParens=0 II=0x5610d7887be0 Text='Bar'
 M=0 C=0 T=Unknown S=0 B=0 BK=0 P=63 Name=l_paren L=10 PPK=2 FakeLParens=
FakeRParens=0 II=0x0 Text='('
 M=0 C=0 T=Unknown S=0 B=0 BK=0 P=99 Name=r_paren L=11 PPK=2 FakeLParens=
FakeRParens=0 II=0x0 Text=')'
 M=0 C=1 T=Unknown S=1 B=0 BK=0 P=63 Name=identifier L=17 PPK=2 FakeLParens=
FakeRParens=0 II=0x5610d7887c10 Text='blech'
 M=0 C=0 T=AttributeSquare S=0 B=0 BK=0 P=63 Name=r_square L=18 PPK=2
FakeLParens= FakeRParens=0 II=0x0 Text=']'
 M=0 C=0 T=AttributeSquare S=0 B=0 BK=0 P=43 Name=r_square L=19 PPK=2
FakeLParens= FakeRParens=0 II=0x0 Text=']'
 M=0 C=0 T=Unknown S=0 B=0 BK=0 P=23 Name=semi L=20 PPK=2 FakeLParens=
FakeRParens=0 II=0x0 Text=';'
----
AnnotatedTokens(L=0):
 M=0 C=0 T=Unknown S=1 B=0 BK=0 P=0 Name=eof L=0 PPK=2 FakeLParens=
FakeRParens=0 II=0x0 Text=''
----
Replacements for run 0:
/tmp/test.m: 3:+0:" "
foo [[Bar() blech]];</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>