<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 - [preamble] Skipped ranges vanish after reparse (#ifdef with #include)"
   href="https://bugs.llvm.org/show_bug.cgi?id=34971">34971</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[preamble] Skipped ranges vanish after reparse (#ifdef with #include)
          </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>Linux
          </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>libclang
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>nikolai.kosjar@qt.io
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>klimek@google.com, llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Source file is:

   % cat $FILE
   #ifdef SOMETHING
   #include <whatever>
   #endif

Parse and save the tokens/skipping ranges:

    % ./c-index-test -test-annotate-tokens=$FILE:1:1:4:1 $FILE > /tmp/1

Reparse and do the same:

    % CINDEXTEST_EDITING=1 ./c-index-test -test-annotate-tokens=$FILE:1:1:4:1
$FILE > /tmp/2

Compare:

    % diff -u /tmp/{1,2}
    --- /tmp/1  2017-10-17 08:31:36.391408230 +0200
    +++ /tmp/2  2017-10-17 08:32:01.215708503 +0200
    @@ -1,4 +1,3 @@
    -Skipping: [1:1 - 3:7]
     Punctuation: "#" [1:1 - 1:2] preprocessing directive=
     Identifier: "ifdef" [1:2 - 1:7] preprocessing directive=
     Identifier: "SOMETHING" [1:8 - 1:17] preprocessing directive=
    zsh: exit 1     colordiff -u /tmp/{1,2}
    % 

==> Ops, skipped ranges are removed after reparse.</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>