[LLVMbugs] [Bug 6413] New: crash with -fsyntax-only multiple virtual bases

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Feb 24 06:23:38 PST 2010


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

           Summary: crash with -fsyntax-only multiple virtual bases
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P5
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: vr086731 at studenti.univr.it
                CC: llvmbugs at cs.uiuc.edu, dgregor at apple.com


template <typename T> class Base_A { };

class Base_B { };

template <typename T>
class Derived
  : public virtual Base_A<T>
  , public virtual Base_B
{ };

llvm_Debug/bin$ ./clang++ -fsyntax-only bug.cc
Stack dump:
0.  Program arguments: llvm_Debug/bin/clang -cc1 -triple i386-pc-linux-gnu
-fsyntax-only -disable-free -main-file-name bug.cc -mrelocation-model static
-mdisable-fp-elim -target-cpu pentium4 -resource-dir llvm_Debug/lib/clang/1.1
-fmessage-length 145 -fexceptions -fgnu-runtime -fdiagnostics-show-option
-fcolor-diagnostics -x c++ bug.cc 
1.  bug.cc:9:1: current parser token '{'
2.  bug.cc:6:1: parsing struct/union/class body 'Derived'
clang: error: compiler command failed due to signal 11 (use -v to see
invocation)

Program received signal SIGSEGV, Segmentation fault.
0x082be031 in llvm::PointerIntPair<clang::TagDecl*, 1u, unsigned int,
llvm::PointerLikeTypeTraits<clang::TagDecl*> >::getPointer (this=0xc) at
llvm/include/llvm/ADT/PointerIntPair.h:69
(gdb) bt
#0  0x082be031 in llvm::PointerIntPair<clang::TagDecl*, 1u, unsigned int,
llvm::PointerLikeTypeTraits<clang::TagDecl*> >::getPointer (this=0xc) at
llvm/include/llvm/ADT/PointerIntPair.h:69
#1  0x082bbe44 in clang::TagType::getDecl (this=0x0) at
llvm/tools/clang/include/clang/AST/Type.h:2105
#2  0x082bbe8b in clang::RecordType::getDecl (this=0x0) at
llvm/tools/clang/include/clang/AST/Type.h:2134
#3  0x0852db49 in clang::CXXRecordDecl::setBases (this=0x897d968,
Bases=0xbfffdb30, NumBases=2) at llvm/tools/clang/lib/AST/DeclCXX.cpp:147
(gdb) f 3
#3  0x0852db49 in clang::CXXRecordDecl::setBases (this=0x897d968,
Bases=0xbfffdb30, NumBases=2) at llvm/tools/clang/lib/AST/DeclCXX.cpp:147
(gdb) l
145       QualType QT = UniqueVbases[i]->getType();
146       CXXRecordDecl *VBaseClassDecl
147         = cast<CXXRecordDecl>(QT->getAs<RecordType>()->getDecl());

Look at frame 2: (this=0x0).
Something is going wrong in that QT->getAs<RecordType>() at line 147.



Stefano Soffia

-- 
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