<html>
    <head>
      <base href="http://llvm.org/bugs/" />
    </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 --- - Assert getting completion results after #ifdef for file ending with a comment and no newline"
   href="http://llvm.org/bugs/show_bug.cgi?id=21132">21132</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Assert getting completion results after #ifdef for file ending with a comment and no newline
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>3.4
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Windows NT
          </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>libclang
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>xda@cypress.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=13116" name="attach_13116" title="Source file that demonstrates the probelm">attachment 13116</a> <a href="attachment.cgi?id=13116&action=edit" title="Source file that demonstrates the probelm">[details]</a></span>
Source file that demonstrates the probelm

Note: this issue exists in clang 3.5 as well but that was not an option.

1. Create a file called test.c with the following contents. Do not include the
spec required line ending at the end of the file. (Or use the attached file.)
int main()
{
#ifdef 1
#endif
    return 0;
}
//With comment on last line of file clang will crash.

2. Run the following command to try to get the code completion options right
before the 1 in the file:
clang.exe -cc1 -fsyntax-only
-code-completion-at="C:\Users\xda\Desktop\test.c":3:8
"C:\Users\xda\Desktop\test.c"

3. Should get back no results but instead get an assert.
Assertion failed: BeginFileID == EndFileID, file
..\tools\clang\lib\AST\RawCommentList.cpp, line 108

4. Note, if you add the newline at the end of the file the issue goes away.</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>