[LLVMbugs] [Bug 8034] New: clang c++ crash explicitly calling overloaded templated conversion operator

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Aug 30 17:21:01 PDT 2010


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

           Summary: clang c++ crash explicitly calling overloaded
                    templated conversion operator
           Product: clang
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: sharparrow1 at yahoo.com
                CC: llvmbugs at cs.uiuc.edu, dgregor at apple.com


Testcase:
struct C {
  operator int();
  template <typename T> operator T();
};
int x = C().operator int();

Backtrace:
#0  0x0000000000eebd2a in clang::Type::getTypeClass (this=0x0)
    at
/home/eli/llvm/tools/clang/lib/Frontend/../../include/clang/AST/Type.h:814
#1  0x0000000000ef8156 in clang::PointerType::classof (T=0x0)
    at
/home/eli/llvm/tools/clang/lib/Frontend/../../include/clang/AST/Type.h:1204
#2  0x0000000000f0a7ae in llvm::isa_impl<clang::PointerType, clang::Type>::doit
    (Val=...) at /home/eli/llvm/include/llvm/Support/Casting.h:55
#3  0x0000000000f0a113 in llvm::isa_impl_wrap<clang::PointerType, clang::Type
const, clang::Type const>::doit (Val=...)
    at /home/eli/llvm/include/llvm/Support/Casting.h:73
#4  0x0000000000f094db in
llvm::isa_impl_cl<clang::Type>::isa<clang::PointerType> (Val=...) at
/home/eli/llvm/include/llvm/Support/Casting.h:85
#5  0x0000000000f2c750 in llvm::isa_impl_cl<clang::Type
const>::isa<clang::PointerType> (Val=...) at
/home/eli/llvm/include/llvm/Support/Casting.h:94
#6  0x0000000000f2a10a in llvm::isa_impl_cl<clang::Type
const*>::isa<clang::PointerType> (Val=0x0) at
/home/eli/llvm/include/llvm/Support/Casting.h:103
#7  0x0000000000f28cc6 in llvm::isa<clang::PointerType, clang::Type const*> (
    Val=@0x7fffffff8528) at /home/eli/llvm/include/llvm/Support/Casting.h:118
#8  0x0000000000f27661 in llvm::dyn_cast<clang::PointerType, clang::Type
const*> (Val=@0x7fffffff8528) at
/home/eli/llvm/include/llvm/Support/Casting.h:228
#9  0x0000000000f264f8 in clang::Type::getAs<clang::PointerType> (this=0x0)
    at
/home/eli/llvm/tools/clang/lib/Frontend/../../include/clang/AST/Type.h:36---Type
<return> to continue, or q <return> to quit---
18
#10 0x00000000014fa452 in clang::ASTContext::UnwrapSimilarPointerTypes (
    this=0x306f8f0, T1=..., T2=...)
    at /home/eli/llvm/tools/clang/lib/AST/ASTContext.cpp:2493
#11 0x00000000012bc4f1 in hasSimilarType (Context=..., T1=..., T2=...)
    at /home/eli/llvm/tools/clang/lib/Sema/SemaOverload.cpp:2128
#12 0x00000000012bc648 in compareStandardConversionSubsets (Context=..., 
    SCS1=..., SCS2=...)
    at /home/eli/llvm/tools/clang/lib/Sema/SemaOverload.cpp:2162
#13 0x00000000012bc74d in clang::Sema::CompareStandardConversionSequences (
    this=0x308a410, SCS1=..., SCS2=...)
    at /home/eli/llvm/tools/clang/lib/Sema/SemaOverload.cpp:2199
#14 0x00000000012c6e06 in clang::Sema::isBetterOverloadCandidate (
    this=0x308a410, Cand1=..., Cand2=..., Loc=...)
    at /home/eli/llvm/tools/clang/lib/Sema/SemaOverload.cpp:5294
#15 0x00000000012c6eaf in clang::Sema::BestViableFunction (this=0x308a410, 
    CandidateSet=..., Loc=..., Best=@0x7fffffffb2c8)
    at /home/eli/llvm/tools/clang/lib/Sema/SemaOverload.cpp:5333
#16 0x00000000012cf1f7 in clang::Sema::BuildCallToMemberFunction (
    this=0x308a410, S=0x3069f20, MemExprE=0x30a50c0, LParenLoc=..., 
    Args=0x7fffffffb628, NumArgs=0, CommaLocs=0x7fffffffb6a8, RParenLoc=...)
    at /home/eli/llvm/tools/clang/lib/Sema/SemaOverload.cpp:7257
#17 0x0000000001244be1 in clang::Sema::ActOnCallExpr (this=0x308a410, 
---Type <return> to continue, or q <return> to quit---
    S=0x3069f20, fn=..., LParenLoc=..., args=..., CommaLocs=0x7fffffffb6a8, 
    RParenLoc=...) at /home/eli/llvm/tools/clang/lib/Sema/SemaExpr.cpp:3634
#18 0x0000000001603733 in clang::Parser::ParsePostfixExpressionSuffix (
    this=0x7fffffffca40, LHS=...)
    at /home/eli/llvm/tools/clang/lib/Parse/ParseExpr.cpp:1028
#19 0x0000000001602bce in clang::Parser::ParseCastExpression (
    this=0x7fffffffca40, isUnaryExpression=false, isAddressOfOperand=false, 
    NotCastExpr=@0x7fffffffba9f, TypeOfCast=0x0)
    at /home/eli/llvm/tools/clang/lib/Parse/ParseExpr.cpp:821
#20 0x0000000001601bee in clang::Parser::ParseCastExpression (
    this=0x7fffffffca40, isUnaryExpression=false, isAddressOfOperand=false, 
    TypeOfCast=0x0) at /home/eli/llvm/tools/clang/lib/Parse/ParseExpr.cpp:431
#21 0x000000000160200b in clang::Parser::ParseCastExpression (
    this=0x7fffffffca40, isUnaryExpression=false, isAddressOfOperand=false, 
    NotCastExpr=@0x7fffffffbd8f, TypeOfCast=0x0)
    at /home/eli/llvm/tools/clang/lib/Parse/ParseExpr.cpp:638
#22 0x0000000001601bee in clang::Parser::ParseCastExpression (
    this=0x7fffffffca40, isUnaryExpression=false, isAddressOfOperand=false, 
    TypeOfCast=0x0) at /home/eli/llvm/tools/clang/lib/Parse/ParseExpr.cpp:431
#23 0x000000000160102e in clang::Parser::ParseAssignmentExpression (
    this=0x7fffffffca40)
    at /home/eli/llvm/tools/clang/lib/Parse/ParseExpr.cpp:230
#24 0x00000000015f6ce1 in clang::Parser::ParseInitializer (this=0x7fffffffca40)
---Type <return> to continue, or q <return> to quit---
    at
/home/eli/llvm/tools/clang/lib/Parse/../../include/clang/Parse/Parser.h:1067
#25 0x00000000015ecdff in clang::Parser::ParseDeclarationAfterDeclarator (
    this=0x7fffffffca40, D=..., TemplateInfo=...)
    at /home/eli/llvm/tools/clang/lib/Parse/ParseDecl.cpp:585
#26 0x00000000015ec5fe in clang::Parser::ParseDeclGroup (this=0x7fffffffca40, 
    DS=..., Context=0, AllowFunctionDefinitions=true, DeclEnd=0x0)
    at /home/eli/llvm/tools/clang/lib/Parse/ParseDecl.cpp:433
#27 0x00000000015e6a72 in clang::Parser::ParseDeclarationOrFunctionDefinition (
    this=0x7fffffffca40, DS=..., Attr=0x0, AS=clang::AS_none)
    at /home/eli/llvm/tools/clang/lib/Parse/Parser.cpp:606
#28 0x00000000015e6adf in clang::Parser::ParseDeclarationOrFunctionDefinition (
    this=0x7fffffffca40, Attr=0x0, AS=clang::AS_none)
    at /home/eli/llvm/tools/clang/lib/Parse/Parser.cpp:613
#29 0x00000000015e63d1 in clang::Parser::ParseExternalDeclaration (
    this=0x7fffffffca40, Attr=...)
    at /home/eli/llvm/tools/clang/lib/Parse/Parser.cpp:497
#30 0x00000000015e5d11 in clang::Parser::ParseTopLevelDecl (
    this=0x7fffffffca40, Result=...)
    at /home/eli/llvm/tools/clang/lib/Parse/Parser.cpp:367
#31 0x0000000001184183 in clang::ParseAST (S=..., PrintStats=false)
    at /home/eli/llvm/tools/clang/lib/Sema/ParseAST.cpp:82
#32 0x0000000000ed53a8 in clang::ASTFrontendAction::ExecuteAction (
---Type <return> to continue, or q <return> to quit---
    this=0x305fab0)
    at /home/eli/llvm/tools/clang/lib/Frontend/FrontendAction.cpp:264
#33 0x0000000000ed4ff2 in clang::FrontendAction::Execute (this=0x305fab0)
    at /home/eli/llvm/tools/clang/lib/Frontend/FrontendAction.cpp:184
#34 0x0000000000ebbd2e in clang::CompilerInstance::ExecuteAction (
    this=0x305f700, Act=...)
    at /home/eli/llvm/tools/clang/lib/Frontend/CompilerInstance.cpp:526
#35 0x0000000000ed3cf4 in clang::ExecuteCompilerInvocation (Clang=0x305f700)
    at
/home/eli/llvm/tools/clang/lib/Frontend/ExecuteCompilerInvocation.cpp:148
#36 0x0000000000eadc5f in cc1_main (ArgBegin=0x7fffffffd3c8, 
    ArgEnd=0x7fffffffd3d8, 
    Argv0=0x305f548 "/home/eli/llvmbin/Debug+Asserts/bin/clang", 
    MainAddr=0xeb52b0)
    at /home/eli/llvm/tools/clang/tools/driver/cc1_main.cpp:160
#37 0x0000000000eb658e in main (argc_=4, argv_=0x7fffffffe2d8)
    at /home/eli/llvm/tools/clang/tools/driver/driver.cpp:268

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