<html>
    <head>
      <base href="http://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - Assertion failed: Cannot retrieve a NULL type pointer"
   href="http://llvm.org/bugs/show_bug.cgi?id=18750">18750</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Assertion failed: Cannot retrieve a NULL type pointer
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>-New Bugs
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>sami.liedes@redlynx.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>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
<a href="http://llvm.org/bugs/">http://llvm.org/bugs/</a> 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: 

********************</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>