[LLVMbugs] [Bug 21132] New: Assert getting completion results after #ifdef for file ending with a comment and no newline

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Oct 2 09:58:41 PDT 2014


http://llvm.org/bugs/show_bug.cgi?id=21132

            Bug ID: 21132
           Summary: Assert getting completion results after #ifdef for
                    file ending with a comment and no newline
           Product: clang
           Version: 3.4
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: libclang
          Assignee: unassignedclangbugs at nondot.org
          Reporter: xda at cypress.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Created attachment 13116
  --> http://llvm.org/bugs/attachment.cgi?id=13116&action=edit
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.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20141002/b218389a/attachment.html>


More information about the llvm-bugs mailing list