[llvm-bugs] [Bug 28508] New: Assertion failed: !isa<TagDecl>(this) || !cast<TagDecl>(this)->isCompleteDefinition()

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Jul 11 10:35:30 PDT 2016


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

            Bug ID: 28508
           Summary: Assertion failed: !isa<TagDecl>(this) ||
                    !cast<TagDecl>(this)->isCompleteDefinition()
           Product: clang
           Version: 3.8
          Hardware: Other
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Frontend
          Assignee: unassignedclangbugs at nondot.org
          Reporter: jtony at ca.ibm.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

This problem only happens when I try to compile the test case as a c file using
clang, if I compile it as a c++ file using clang++, there is no assertion.

Steps to reproduce on linux:
-bash-4.2$ cat r.c
int main()
{
  typedef char* CHARPT;
  for (struct CHARPT {int i;} a;;) {}
  return 55;
}

-bash-4.2$ clang  r.c
r.c:4:15: error: declaration of non-local variable in 'for' loop
  for (struct CHARPT {int i;} a;;) {}
              ^
clang: /home/jtony/build/3_8/llvm-dev.src/tools/clang/lib/AST/DeclBase.cpp:113:
void clang::Decl::setInvalidDecl(bool): Assertion `!isa<TagDecl>(this) ||
!cast<TagDecl>(this)->isCompleteDefinition()' failed.
...
1.      r.c:5:3: current parser token 'return'
2.      r.c:2:1: parsing function body 'main'
3.      r.c:2:1: in compound statement ('{}')
clang: error: unable to execute command: Aborted (core dumped)
clang: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 3.8.0 (tags/RELEASE_380/final)
Target: powerpc64le-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/jtony/build/runnable/bin

-- 
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/20160711/2c86bce7/attachment.html>


More information about the llvm-bugs mailing list