[LLVMbugs] [Bug 13900] New: crash-on-invalid: Assertion failed: (!isNull() && "Cannot retrieve a NULL type pointer"), function getCommonPtr when diagnosing deduction failure
bugzilla-daemon at llvm.org
bugzilla-daemon at llvm.org
Sat Sep 22 02:12:51 PDT 2012
http://llvm.org/bugs/show_bug.cgi?id=13900
Bug #: 13900
Summary: crash-on-invalid: Assertion failed: (!isNull() &&
"Cannot retrieve a NULL type pointer"), function
getCommonPtr when diagnosing deduction failure
Product: clang
Version: trunk
Platform: PC
OS/Version: All
Status: NEW
Keywords: crash-on-invalid
Severity: enhancement
Priority: P
Component: C++
AssignedTo: unassignedclangbugs at nondot.org
ReportedBy: benny.kra at gmail.com
CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
Classification: Unclassified
$ cat t.cc
template<class _Tp> struct iterator { };
template<typename NodeTy> class ilist_iterator : public iterator<NodeTy> { };
template<typename T> bool operator==(const T* LHS, const ilist_iterator<const
T> &RHS);
bool foo(ilist_iterator<int> i, int *j) {
return j == i;
}
$ clang -fsyntax-only t.cc
t.cc:7:12: error: invalid operands to binary expression ('int *' and
'ilist_iterator<int>')
return j == i;
~ ^ ~
Assertion failed: (!isNull() && "Cannot retrieve a NULL type pointer"),
function getCommonPtr, file
/Users/d0k/build/llvm/tools/clang/lib/AST/../../include/clang/AST/Type.h, line
558.
0 libLLVM-3.2svn.dylib 0x0000000114b8898e PrintStackTrace(void*) + 46
1 libLLVM-3.2svn.dylib 0x0000000114b88fa8 SignalHandler(int) + 408
2 libsystem_c.dylib 0x00007fff8bc448ea _sigtramp + 26
3 libsystem_c.dylib 0x00007fff5036d718 _sigtramp + 18446744072710426184
4 libLLVM-3.2svn.dylib 0x0000000114b88c5b raise + 27
5 libLLVM-3.2svn.dylib 0x0000000114b88d12 abort + 18
6 libLLVM-3.2svn.dylib 0x0000000114b88cf1 __assert_rtn + 129
7 clang 0x0000000110bb5136 clang::QualType::getCommonPtr()
const + 102
8 clang 0x0000000110b7dec9 clang::QualType::getCanonicalType()
const + 25
9 clang 0x0000000110b7e27c
clang::ASTContext::getCanonicalType(clang::QualType) const + 28
10 clang 0x0000000110b8bcc0
clang::ASTContext::hasSameType(clang::QualType, clang::QualType) const + 48
11 clang 0x00000001101688d0 clang::(anonymous
namespace)::DiagnoseBadDeduction(clang::Sema&, clang::OverloadCandidate*,
unsigned int) + 768
12 clang 0x000000011015732a clang::(anonymous
namespace)::NoteFunctionCandidate(clang::Sema&, clang::OverloadCandidate*,
unsigned int) + 714
13 clang 0x0000000110147ed4
clang::OverloadCandidateSet::NoteCandidates(clang::Sema&,
clang::OverloadCandidateDisplayKind, llvm::ArrayRef<clang::Expr*>, char const*,
clang::SourceLocation) + 756
14 clang 0x000000011015dfcf
clang::Sema::CreateOverloadedBinOp(clang::SourceLocation, unsigned int,
clang::UnresolvedSetImpl const&, clang::Expr*, clang::Expr*) + 5087
15 clang 0x000000011000adc8 BuildOverloadedBinOp(clang::Sema&,
clang::Scope*, clang::SourceLocation, clang::BinaryOperatorKind, clang::Expr*,
clang::Expr*) + 280
16 clang 0x000000011000ac62
clang::Sema::BuildBinOp(clang::Scope*, clang::SourceLocation,
clang::BinaryOperatorKind, clang::Expr*, clang::Expr*) + 1218
17 clang 0x000000010ffe5841
clang::Sema::ActOnBinOp(clang::Scope*, clang::SourceLocation,
clang::tok::TokenKind, clang::Expr*, clang::Expr*) + 289
18 clang 0x000000010fd9830e
clang::Parser::ParseRHSOfBinaryExpression(clang::ActionResult<clang::Expr*,
true>, clang::prec::Level) + 3902
19 clang 0x000000010fd973b6
clang::Parser::ParseAssignmentExpression(clang::Parser::TypeCastState) + 230
20 clang 0x000000010fd9729f
clang::Parser::ParseExpression(clang::Parser::TypeCastState) + 31
21 clang 0x000000010fdca871
clang::Parser::ParseReturnStatement() + 577
22 clang 0x000000010fdc5f87
clang::Parser::ParseStatementOrDeclarationAfterAttributes(llvm::SmallVector<clang::Stmt*,
32u>&, bool, clang::SourceLocation*, clang::Parser::ParsedAttributesWithRange&)
+ 2583
23 clang 0x000000010fdc5425
clang::Parser::ParseStatementOrDeclaration(llvm::SmallVector<clang::Stmt*,
32u>&, bool, clang::SourceLocation*) + 133
24 clang 0x000000010fdcc3a0
clang::Parser::ParseCompoundStatementBody(bool) + 1456
25 clang 0x000000010fdcdf01
clang::Parser::ParseFunctionStatementBody(clang::Decl*,
clang::Parser::ParseScope&) + 289
26 clang 0x000000010fddfcd4
clang::Parser::ParseFunctionDefinition(clang::ParsingDeclarator&,
clang::Parser::ParsedTemplateInfo const&,
llvm::SmallVector<clang::Parser::LateParsedAttribute*, 2u>*) + 3812
27 clang 0x000000010fd72cec
clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&, unsigned int, bool,
clang::SourceLocation*, clang::Parser::ForRangeInit*) + 476
28 clang 0x000000010fddeddd
clang::Parser::ParseDeclOrFunctionDefInternal(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec&, clang::AccessSpecifier) + 1133
29 clang 0x000000010fdde571
clang::Parser::ParseDeclarationOrFunctionDefinition(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*, clang::AccessSpecifier) + 161
30 clang 0x000000010fdddc80
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*) + 3216
31 clang 0x000000010fddcf82
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&) + 466
32 clang 0x000000010fd653fb clang::ParseAST(clang::Sema&, bool,
bool) + 683
33 clang 0x000000010f97a909
clang::ASTFrontendAction::ExecuteAction() + 489
34 clang 0x000000010f97a46d clang::FrontendAction::Execute() +
237
35 clang 0x000000010f933b62
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 946
36 clang 0x000000010f8a97fa
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 1898
37 clang 0x000000010f88aef6 cc1_main(char const**, char const**,
char const*, void*) + 1206
38 clang 0x000000010f89f397 main + 583
39 libdyld.dylib 0x00007fff88df97e1 start + 0
Stack dump:
0. Program arguments: /Users/d0k/build/llvm/Debug+Asserts/bin/clang -cc1
-triple x86_64-apple-macosx10.8.0 -fsyntax-only -disable-free -main-file-name
t.cc -pic-level 2 -mdisable-fp-elim -masm-verbose -munwind-tables -target-cpu
core2 -target-linker-version 133.3 -resource-dir
/Users/d0k/build/llvm/Debug+Asserts/bin/../lib/clang/3.2 -fmodule-cache-path
/var/folders/lt/l_19g5c51sdbnz6zp3px4bpw0000gn/T/clang-module-cache
-fdeprecated-macro -fdebug-compilation-dir /tmp -ferror-limit 19
-fmessage-length 110 -stack-protector 1 -mstackrealign -fblocks
-fobjc-runtime=macosx-10.8.0 -fobjc-dispatch-method=mixed
-fobjc-default-synthesize-properties -fcxx-exceptions -fexceptions
-fdiagnostics-show-option -fcolor-diagnostics -x c++ t.cc
1. t.cc:7:16: current parser token ';'
2. t.cc:6:41: parsing function body 'foo'
3. t.cc:6:41: in compound statement ('{}')
clang: error: unable to execute command: Illegal instruction: 4
clang: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 3.2 (trunk 164401) (llvm/trunk 164402)
--
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