[LLVMbugs] [Bug 18719] New: crash on valid, lambda inside function template
bugzilla-daemon at llvm.org
bugzilla-daemon at llvm.org
Mon Feb 3 21:34:51 PST 2014
http://llvm.org/bugs/show_bug.cgi?id=18719
Bug ID: 18719
Summary: crash on valid, lambda inside function template
Product: clang
Version: trunk
Hardware: PC
OS: Linux
Status: NEW
Severity: normal
Priority: P
Component: C++11
Assignee: unassignedclangbugs at nondot.org
Reporter: nlewycky at google.com
CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
Classification: Unclassified
This code:
template <typename AckWriter> void StaggeredReissue() {
typedef AckWriter AckChannel;
AckChannel acks_a(0);
(([acks_a]
{
acks_a.writer;
}));
}
parsed with -std=gnu++11 produces no diagnostics, then this crash:
clang:
/usr/local/google/home/nlewycky/llvm/tools/clang/lib/Frontend/../../include/clang/AST/Type.h:547:
const clang::ExtQualsTypeCommonBase* clang::QualType::getCommonPtr() const:
Assertion `!isNull() && "Cannot retrieve a NULL type pointer"' failed.
0 clang 0x0000000003442ebb llvm::sys::PrintStackTrace(_IO_FILE*) +
38
1 clang 0x0000000003443138
2 clang 0x0000000003442ba1
3 libpthread.so.0 0x00007fc022f81cb0
4 libc.so.6 0x00007fc0222b9425 gsignal + 53
5 libc.so.6 0x00007fc0222bcb8b abort + 379
6 libc.so.6 0x00007fc0222b20ee
7 libc.so.6 0x00007fc0222b2192
8 clang 0x0000000000cb8ef1
9 clang 0x0000000000cb92ca
10 clang 0x0000000000cb8fe2
11 clang 0x00000000021098b7
clang::Expr::EvaluateAsInitializer(clang::APValue&, clang::ASTContext const&,
clang::VarDecl const*, llvm::SmallVectorImpl<std::pair<clang::SourceLocation,
clang::PartialDiagnostic> >&) const + 119
12 clang 0x000000000209218f
clang::VarDecl::evaluateValue(llvm::SmallVectorImpl<std::pair<clang::SourceLocation,
clang::PartialDiagnostic> >&) const + 265
13 clang 0x00000000020923be clang::VarDecl::checkInitIsICE() const +
250
14 clang 0x00000000014a3039
15 clang 0x00000000014a32a9
16 clang 0x00000000014a3711
clang::Sema::ActOnFinishFullExpr(clang::Expr*, clang::SourceLocation, bool,
bool, bool) + 681
17 clang 0x000000000155c120
clang::Sema::ActOnExprStmt(clang::ActionResult<clang::Expr*, true>) + 108
18 clang 0x00000000011f7989 clang::Parser::ParseExprStatement() + 529
19 clang 0x00000000011f71b2
clang::Parser::ParseStatementOrDeclarationAfterAttributes(llvm::SmallVector<clang::Stmt*,
32u>&, bool, clang::SourceLocation*, clang::Parser::ParsedAttributesWithRange&)
+ 1380
20 clang 0x00000000011f68fa
clang::Parser::ParseStatementOrDeclaration(llvm::SmallVector<clang::Stmt*,
32u>&, bool, clang::SourceLocation*) + 128
21 clang 0x00000000011f9667
clang::Parser::ParseCompoundStatementBody(bool) + 1139
22 clang 0x00000000011d8dbf
clang::Parser::ParseLambdaExpressionAfterIntroducer(clang::LambdaIntroducer&) +
2881
23 clang 0x00000000011d7382 clang::Parser::ParseLambdaExpression() +
266
24 clang 0x00000000011ced3b clang::Parser::ParseCastExpression(bool,
bool, bool&, clang::Parser::TypeCastState) + 8317
25 clang 0x00000000011ccbde clang::Parser::ParseCastExpression(bool,
bool, clang::Parser::TypeCastState) + 54
26 clang 0x00000000011cbcd3
clang::Parser::ParseAssignmentExpression(clang::Parser::TypeCastState) + 171
27 clang 0x00000000011cbafa
clang::Parser::ParseExpression(clang::Parser::TypeCastState) + 32
28 clang 0x00000000011d3145
clang::Parser::ParseParenExpression(clang::Parser::ParenParseOption&, bool,
bool, clang::OpaquePtr<clang::QualType>&, clang::SourceLocation&) + 4243
29 clang 0x00000000011cce07 clang::Parser::ParseCastExpression(bool,
bool, bool&, clang::Parser::TypeCastState) + 329
30 clang 0x00000000011ccbde clang::Parser::ParseCastExpression(bool,
bool, clang::Parser::TypeCastState) + 54
31 clang 0x00000000011cbcd3
clang::Parser::ParseAssignmentExpression(clang::Parser::TypeCastState) + 171
32 clang 0x00000000011cbafa
clang::Parser::ParseExpression(clang::Parser::TypeCastState) + 32
33 clang 0x00000000011d3145
clang::Parser::ParseParenExpression(clang::Parser::ParenParseOption&, bool,
bool, clang::OpaquePtr<clang::QualType>&, clang::SourceLocation&) + 4243
34 clang 0x00000000011cce07 clang::Parser::ParseCastExpression(bool,
bool, bool&, clang::Parser::TypeCastState) + 329
35 clang 0x00000000011ccbde clang::Parser::ParseCastExpression(bool,
bool, clang::Parser::TypeCastState) + 54
36 clang 0x00000000011cbcd3
clang::Parser::ParseAssignmentExpression(clang::Parser::TypeCastState) + 171
37 clang 0x00000000011cbafa
clang::Parser::ParseExpression(clang::Parser::TypeCastState) + 32
38 clang 0x00000000011f77bd clang::Parser::ParseExprStatement() + 69
39 clang 0x00000000011f71b2
clang::Parser::ParseStatementOrDeclarationAfterAttributes(llvm::SmallVector<clang::Stmt*,
32u>&, bool, clang::SourceLocation*, clang::Parser::ParsedAttributesWithRange&)
+ 1380
40 clang 0x00000000011f68fa
clang::Parser::ParseStatementOrDeclaration(llvm::SmallVector<clang::Stmt*,
32u>&, bool, clang::SourceLocation*) + 128
41 clang 0x00000000011f9667
clang::Parser::ParseCompoundStatementBody(bool) + 1139
42 clang 0x00000000011ff4f4
clang::Parser::ParseFunctionStatementBody(clang::Decl*,
clang::Parser::ParseScope&) + 322
43 clang 0x0000000001198ca6
clang::Parser::ParseFunctionDefinition(clang::ParsingDeclarator&,
clang::Parser::ParsedTemplateInfo const&, clang::Parser::LateParsedAttrList*) +
3052
44 clang 0x0000000001201ecf
clang::Parser::ParseSingleDeclarationAfterTemplate(unsigned int,
clang::Parser::ParsedTemplateInfo const&, clang::ParsingDeclRAIIObject&,
clang::SourceLocation&, clang::AccessSpecifier, clang::AttributeList*) + 2011
45 clang 0x00000000012016a6
clang::Parser::ParseTemplateDeclarationOrSpecialization(unsigned int,
clang::SourceLocation&, clang::AccessSpecifier, clang::AttributeList*) + 966
46 clang 0x00000000012012c7
clang::Parser::ParseDeclarationStartingWithTemplate(unsigned int,
clang::SourceLocation&, clang::AccessSpecifier, clang::AttributeList*) + 209
47 clang 0x00000000011a8da1
clang::Parser::ParseDeclaration(llvm::SmallVector<clang::Stmt*, 32u>&, unsigned
int, clang::SourceLocation&, clang::Parser::ParsedAttributesWithRange&) + 239
48 clang 0x00000000011971cd
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*) + 1637
49 clang 0x0000000001196b1d
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&) + 535
50 clang 0x000000000118f5ff clang::ParseAST(clang::Sema&, bool, bool)
+ 396
51 clang 0x0000000000d14f40 clang::ASTFrontendAction::ExecuteAction()
+ 322
52 clang 0x0000000000f80bbd clang::CodeGenAction::ExecuteAction() +
1221
53 clang 0x0000000000d14a73 clang::FrontendAction::Execute() + 205
54 clang 0x0000000000ce9204
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 720
55 clang 0x0000000000cb5da8
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 1074
56 clang 0x0000000000ca7749 cc1_main(char const**, char const**, char
const*, void*) + 636
57 clang 0x0000000000cb18b8 main + 770
58 libc.so.6 0x00007fc0222a476d __libc_start_main + 237
59 clang 0x0000000000ca5e19
Stack dump:
0. Program arguments:
/usr/local/google/home/nlewycky/llvm/Debug+Asserts/bin/clang -cc1 -triple
x86_64-unknown-linux-gnu -emit-obj -mrelax-all -disable-free -main-file-name
r.cc -mrelocation-model static -mdisable-fp-elim -fmath-errno -masm-verbose
-mconstructor-aliases -munwind-tables -target-cpu x86-64 -target-linker-version
2.23.52.20130808 -resource-dir
/usr/local/google/home/nlewycky/llvm/Debug+Asserts/bin/../lib/clang/3.5
-internal-isystem /usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6
-internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/x86_64-linux-gnu
-internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/backward
-internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/x86_64-linux-gnu/c++/4.6
-internal-isystem /usr/local/include -internal-isystem
/usr/local/google/home/nlewycky/llvm/Debug+Asserts/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=gnu++11 -fdeprecated-macro -fdebug-compilation-dir
/usr/local/google/home/nlewycky/creduce -ferror-limit 19 -fmessage-length 80
-mstackrealign -fobjc-runtime=gcc -fcxx-exceptions -fexceptions
-fdiagnostics-show-option -fcolor-diagnostics -vectorize-slp -o /tmp/r-c6c148.o
-x c++ r.cc
1. r.cc:7:5: current parser token '}'
2. r.cc:1:55: parsing function body 'StaggeredReissue'
3. r.cc:1:55: in compound statement ('{}')
4. r.cc:4:5: lambda expression parsing
5. r.cc:5:5: in compound statement ('{}')
clang: error: unable to execute command: Aborted (core dumped)
clang: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 3.5 (trunk 200720) (llvm/trunk 192017:200720M)
Target: x86_64-unknown-linux-gnu
Thread model: posix
How did we get into EvaluateAsInitializer?
--
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/20140204/c3e698fa/attachment.html>
More information about the llvm-bugs
mailing list