[LLVMbugs] [Bug 7198] New: Assertion failure "Did not find a destructor!" in clang on valid code

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sat May 22 09:47:12 PDT 2010


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

           Summary: Assertion failure "Did not find a destructor!" in
                    clang on valid code
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Keywords: compile-fail
          Severity: normal
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: jbytheway+llvm at gmail.com
                CC: llvmbugs at cs.uiuc.edu, dgregor at apple.com


clang suffers an assertion failure when compiling this valid C++ code (which
g++ compiles fine):

==========
struct A
{
  ~A() { }
};

template<typename T>
struct B {
  struct C : A {};
  void f()
  {
    C c = C();
  }
};

int main() { return 0; }
==========

The error message is:

$ clang ice.cpp
clang: DeclCXX.cpp:578: clang::CXXDestructorDecl*
clang::CXXRecordDecl::getDestructor(clang::ASTContext&) const: Assertion `I !=
E && "Did not find a destructor!"' failed.
0  clang           0x00000000012864af
1  clang           0x0000000001288639
2  libpthread.so.0 0x00007f0a2eb69a40
3  libc.so.6       0x00007f0a2de8b065 gsignal + 53
4  libc.so.6       0x00007f0a2de8c490 abort + 384
5  libc.so.6       0x00007f0a2de8410a __assert_fail + 234
6  clang           0x00000000008f7afc
7  clang           0x000000000067308c
8  clang           0x000000000065c282
9  clang           0x000000000065ca46
10 clang           0x000000000098033a
11 clang           0x0000000000986a83
12 clang           0x0000000000987788
13 clang           0x00000000009878ec
14 clang           0x000000000096e199
15 clang           0x000000000096ef56
16 clang           0x000000000096f8b1
17 clang           0x00000000009aea3e
18 clang           0x00000000009912c0
19 clang           0x0000000000991efc
20 clang           0x0000000000983e9c
21 clang           0x00000000009ad68d
22 clang           0x00000000009ae3bc
23 clang           0x00000000009ae63b
24 clang           0x00000000009879cd
25 clang           0x000000000097c5e0
26 clang           0x000000000097c7ea
27 clang           0x000000000061756b
28 clang           0x000000000041de8f
29 clang           0x0000000000409c8e
30 clang           0x000000000040fcd1 main + 3137
31 libc.so.6       0x00007f0a2de77a3d __libc_start_main + 253
32 clang           0x0000000000407639
Stack dump:
0.      Program arguments: .../llvm/Debug/bin/clang -cc1 -triple
x86_64-unknown-linux-gnu -S -disable-free -main-file-name ice.cpp
-mrelocation-model static -mdisable-fp-elim -mconstructor-aliases
-munwind-tables -target-cpu x86-64 -resource-dir .../llvm/Debug/lib/clang/2.0
-ferror-limit 19 -fmessage-length 80 -fexceptions -fgnu-runtime
-fdiagnostics-show-option -fcolor-diagnostics -o /tmp/cc-lc2ugx.s -x c++
ice.cpp 
1.      ice.cpp:11:14: current parser token ';'
2.      ice.cpp:7:1: parsing struct/union/class body 'B'
3.      ice.cpp:10:3: parsing function body 'B::f'
4.      ice.cpp:10:3: in compound statement ('{}')
clang: error: clang frontend command failed due to signal 6 (use -v to see
invocation)

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list