[LLVMbugs] [Bug 18750] New: Assertion failed: Cannot retrieve a NULL type pointer

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Feb 6 00:58:42 PST 2014


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

            Bug ID: 18750
           Summary: Assertion failed: Cannot retrieve a NULL type pointer
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: sami.liedes at redlynx.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

On today's trunk:

--- t.cpp --------------------
class A {
        template <typename B>
        int e(const B &) {
                decltype(B::x) c(*this);
                return []() { c; };
        }
};

void f() {
        A d;
        d.e(0);
}
------------------------------

$ clang++ -c -std=c++11 t.cpp
clang-3.5:
/home/sliedes/projects/llvm/llvm.src/tools/clang/include/clang/AST/Type.h:547:
const clang::ExtQualsTypeCommonBase *clang::QualType::getCommonPtr() const:
Assertion `!isNull() && "Cannot retrieve a NULL type pointer"' failed.
0  clang-3.5       0x000000000160a85e llvm::sys::PrintStackTrace(_IO_FILE*) +
46
1  clang-3.5       0x000000000160ab1b
2  clang-3.5       0x000000000160ad8e
3  libpthread.so.0 0x00007fa24ae95210
4  libc.so.6       0x00007fa24a0e01d5 gsignal + 53
5  libc.so.6       0x00007fa24a0e3388 abort + 328
6  libc.so.6       0x00007fa24a0d9252
7  libc.so.6       0x00007fa24a0d9302
8  clang-3.5       0x00000000018919a5
9  clang-3.5       0x0000000001891955
10 clang-3.5       0x0000000001894a45
11 clang-3.5       0x0000000003593508
clang::Expr::EvaluateAsInitializer(clang::APValue&, clang::ASTContext const&,
clang::VarDecl const*, llvm::SmallVectorImpl<std::pair<clang::SourceLocation,
clang::PartialDiagnostic> >&) const + 88
12 clang-3.5       0x0000000003528ec5
clang::VarDecl::evaluateValue(llvm::SmallVectorImpl<std::pair<clang::SourceLocation,
clang::PartialDiagnostic> >&) const + 341
13 clang-3.5       0x00000000035291b0 clang::VarDecl::checkInitIsICE() const +
288
14 clang-3.5       0x0000000002d6cc37
15 clang-3.5       0x0000000002d6c524
16 clang-3.5       0x0000000002d6c293
clang::Sema::ActOnFinishFullExpr(clang::Expr*, clang::SourceLocation, bool,
bool, bool) + 771
17 clang-3.5       0x0000000002e48f57
clang::Sema::ActOnExprStmt(clang::ActionResult<clang::Expr*, true>) + 135
18 clang-3.5       0x000000000290754d clang::Parser::ParseExprStatement() + 557
19 clang-3.5       0x00000000029065be
clang::Parser::ParseStatementOrDeclarationAfterAttributes(llvm::SmallVector<clang::Stmt*,
32u>&, bool, clang::SourceLocation*, clang::Parser::ParsedAttributesWithRange&)
+ 1726
20 clang-3.5       0x0000000002905de5
clang::Parser::ParseStatementOrDeclaration(llvm::SmallVector<clang::Stmt*,
32u>&, bool, clang::SourceLocation*) + 133
21 clang-3.5       0x000000000290cbec
clang::Parser::ParseCompoundStatementBody(bool) + 1388
22 clang-3.5       0x00000000028e40ec
clang::Parser::ParseLambdaExpressionAfterIntroducer(clang::LambdaIntroducer&) +
3548
23 clang-3.5       0x00000000028e2624 clang::Parser::ParseLambdaExpression() +
308
24 clang-3.5       0x00000000028d752d clang::Parser::ParseCastExpression(bool,
bool, bool&, clang::Parser::TypeCastState) + 9645
25 clang-3.5       0x00000000028d3623 clang::Parser::ParseCastExpression(bool,
bool, clang::Parser::TypeCastState) + 83
26 clang-3.5       0x00000000028d2528
clang::Parser::ParseAssignmentExpression(clang::Parser::TypeCastState) + 200
27 clang-3.5       0x00000000028d242f
clang::Parser::ParseExpression(clang::Parser::TypeCastState) + 31
28 clang-3.5       0x000000000290b1b7 clang::Parser::ParseReturnStatement() +
519
29 clang-3.5       0x00000000029067bb
clang::Parser::ParseStatementOrDeclarationAfterAttributes(llvm::SmallVector<clang::Stmt*,
32u>&, bool, clang::SourceLocation*, clang::Parser::ParsedAttributesWithRange&)
+ 2235
30 clang-3.5       0x0000000002905de5
clang::Parser::ParseStatementOrDeclaration(llvm::SmallVector<clang::Stmt*,
32u>&, bool, clang::SourceLocation*) + 133
31 clang-3.5       0x000000000290cbec
clang::Parser::ParseCompoundStatementBody(bool) + 1388
32 clang-3.5       0x000000000290fd6f
clang::Parser::ParseFunctionStatementBody(clang::Decl*,
clang::Parser::ParseScope&) + 319
33 clang-3.5       0x00000000029216a7
clang::Parser::ParseLexedMethodDef(clang::Parser::LexedMethod&) + 1447
34 clang-3.5       0x00000000029210f4
clang::Parser::LexedMethod::ParseLexedMethodDefs() + 36
35 clang-3.5       0x0000000002920912
clang::Parser::ParseLexedMethodDefs(clang::Parser::ParsingClass&) + 306
36 clang-3.5       0x00000000028c77a8
clang::Parser::ParseCXXMemberSpecification(clang::SourceLocation,
clang::SourceLocation, clang::Parser::ParsedAttributesWithRange&, unsigned int,
clang::Decl*) + 4168
37 clang-3.5       0x00000000028c630d
clang::Parser::ParseClassSpecifier(clang::tok::TokenKind,
clang::SourceLocation, clang::DeclSpec&, clang::Parser::ParsedTemplateInfo
const&, clang::AccessSpecifier, bool, clang::Parser::DeclSpecContext,
clang::Parser::ParsedAttributesWithRange&) + 9389
38 clang-3.5       0x00000000028a8bee
clang::Parser::ParseDeclarationSpecifiers(clang::DeclSpec&,
clang::Parser::ParsedTemplateInfo const&, clang::AccessSpecifier,
clang::Parser::DeclSpecContext, clang::Parser::LateParsedAttrList*) + 10270
39 clang-3.5       0x0000000002890d36
clang::Parser::ParseDeclOrFunctionDefInternal(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec&, clang::AccessSpecifier) + 102
40 clang-3.5       0x0000000002890913
clang::Parser::ParseDeclarationOrFunctionDefinition(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*, clang::AccessSpecifier) + 147
41 clang-3.5       0x00000000028900a1
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*) + 3457
42 clang-3.5       0x000000000288f2bc
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&) + 700
43 clang-3.5       0x000000000288ae76 clang::ParseAST(clang::Sema&, bool, bool)
+ 326
44 clang-3.5       0x00000000017d4499 clang::ASTFrontendAction::ExecuteAction()
+ 345
45 clang-3.5       0x0000000001e2c237 clang::CodeGenAction::ExecuteAction() +
1479
46 clang-3.5       0x00000000017d3fbf clang::FrontendAction::Execute() + 191
47 clang-3.5       0x00000000017a0ead
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 797
48 clang-3.5       0x00000000018fa209
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 1049
49 clang-3.5       0x00000000008901aa cc1_main(char const**, char const**, char
const*, void*) + 698
50 clang-3.5       0x0000000000888554 main + 772
51 libc.so.6       0x00007fa24a0cc995 __libc_start_main + 245
52 clang-3.5       0x0000000000888104
Stack dump:
0.    Program arguments: /home/sliedes/local/llvm-trunk-dbg/bin/clang-3.5 -cc1
-triple x86_64-unknown-linux-gnu -emit-obj -mrelax-all -disable-free
-main-file-name t.cpp -mrelocation-model static -mdisable-fp-elim -fmath-errno
-masm-verbose -mconstructor-aliases -munwind-tables -fuse-init-array
-target-cpu x86-64 -coverage-file /home/sliedes/t/t.o -resource-dir
/home/sliedes/local/llvm-trunk-dbg/bin/../lib/clang/3.5 -internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8 -internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8/x86_64-linux-gnu
-internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8/backward
-internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../include/x86_64-linux-gnu/c++/4.8
-internal-isystem /usr/local/include -internal-isystem
/home/sliedes/local/llvm-trunk-dbg/bin/../lib/clang/3.5/include
-internal-externc-isystem /usr/include/x86_64-linux-gnu
-internal-externc-isystem /include -internal-externc-isystem /usr/include
-std=c++11 -fdeprecated-macro -fdebug-compilation-dir /home/sliedes/t
-ferror-limit 19 -fmessage-length 0 -mstackrealign -fobjc-runtime=gcc
-fcxx-exceptions -fexceptions -fdiagnostics-show-option -vectorize-slp -o t.o
-x c++ t.cpp 
1.    t.cpp:5:20: current parser token '}'
2.    t.cpp:1:1: parsing struct/union/class body 'A'
3.    t.cpp:3:19: parsing function body 'e'
4.    t.cpp:3:19: in compound statement ('{}')
5.    t.cpp:5:10: lambda expression parsing
6.    t.cpp:5:15: in compound statement ('{}')
clang-3.5: error: unable to execute command: Aborted
clang-3.5: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 3.5 
Target: x86_64-unknown-linux-gnu
Thread model: posix
clang-3.5: note: diagnostic msg: PLEASE submit a bug report to
http://llvm.org/bugs/ and include the crash backtrace, preprocessed source, and
associated run script.
clang-3.5: note: diagnostic msg: 
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-3.5: note: diagnostic msg: /tmp/t-7bba96.cpp
clang-3.5: note: diagnostic msg: /tmp/t-7bba96.sh
clang-3.5: note: diagnostic msg: 

********************

-- 
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/20140206/055ed222/attachment.html>


More information about the llvm-bugs mailing list