<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 --- - Crash on invalid in lambda expression"
href="http://llvm.org/bugs/show_bug.cgi?id=20705">20705</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Crash on invalid in lambda expression
</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>Linux
</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>Frontend
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>rtrieu@google.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>test.cc:
template <typename T>
struct X {};
auto b = []() {
struct S {
static typename X<decltype(int)>::type Run(){};
};
return 5;
}();
commandline:
clang -cc1 test.cc -fsyntax-only -std=c++11
output:
test.cc:5:35: error: expected '(' for function-style cast or type construction
static typename X<decltype(int)>::type Run(){};
~~~^
test.cc:5:39: error: non-friend class member 'type' cannot have a qualified
name
static typename X<decltype(int)>::type Run(){};
~~^
test.cc:5:39: error: no member named 'type' in the global namespace
static typename X<decltype(int)>::type Run(){};
~~^
0 clang 0x00000000011a94e5 llvm::sys::PrintStackTrace(_IO_FILE*) +
37
1 clang 0x00000000011a9933
2 libpthread.so.0 0x00007f3556996cb0
3 clang 0x0000000001bd23dc
clang::Sema::FinalizeDeclaration(clang::Decl*) + 204
4 clang 0x00000000019ba470
clang::Parser::ParseCXXClassMemberDeclaration(clang::AccessSpecifier,
clang::AttributeList*, clang::Parser::ParsedTemplateInfo const&,
clang::ParsingDeclRAIIObject*) + 6960
5 clang 0x00000000019b6ace
clang::Parser::ParseCXXMemberSpecification(clang::SourceLocation,
clang::SourceLocation, clang::Parser::ParsedAttributesWithRange&, unsigned int,
clang::Decl*) + 3086
6 clang 0x00000000019b4c38
clang::Parser::ParseClassSpecifier(clang::tok::TokenKind,
clang::SourceLocation, clang::DeclSpec&, clang::Parser::ParsedTemplateInfo
const&, clang::AccessSpecifier, bool, clang::Parser::DeclSpecContext,
clang::Parser::ParsedAttributesWithRange&) + 7064
7 clang 0x000000000199a4f9
clang::Parser::ParseDeclarationSpecifiers(clang::DeclSpec&,
clang::Parser::ParsedTemplateInfo const&, clang::AccessSpecifier,
clang::Parser::DeclSpecContext, clang::Parser::LateParsedAttrList*) + 1577
8 clang 0x0000000001999d6b
clang::Parser::ParseSimpleDeclaration(llvm::SmallVector<clang::Stmt*, 32u>&,
unsigned int, clang::SourceLocation&,
clang::Parser::ParsedAttributesWithRange&, bool, clang::Parser::ForRangeInit*)
+ 379
9 clang 0x0000000001999b87
clang::Parser::ParseDeclaration(llvm::SmallVector<clang::Stmt*, 32u>&, unsigned
int, clang::SourceLocation&, clang::Parser::ParsedAttributesWithRange&) + 599
10 clang 0x00000000019f3b86
clang::Parser::ParseStatementOrDeclarationAfterAttributes(llvm::SmallVector<clang::Stmt*,
32u>&, bool, clang::SourceLocation*, clang::Parser::ParsedAttributesWithRange&)
+ 2726
11 clang 0x00000000019f306f
clang::Parser::ParseStatementOrDeclaration(llvm::SmallVector<clang::Stmt*,
32u>&, bool, clang::SourceLocation*) + 143
12 clang 0x00000000019f954f
clang::Parser::ParseCompoundStatementBody(bool) + 1423
13 clang 0x00000000019d0799
clang::Parser::ParseLambdaExpressionAfterIntroducer(clang::LambdaIntroducer&) +
4265
14 clang 0x00000000019cec10 clang::Parser::ParseLambdaExpression() +
288
15 clang 0x00000000019c2c96 clang::Parser::ParseCastExpression(bool,
bool, bool&, clang::Parser::TypeCastState) + 5046
16 clang 0x00000000019bf0a2
clang::Parser::ParseAssignmentExpression(clang::Parser::TypeCastState) + 130
17 clang 0x000000000199f235
clang::Parser::ParseDeclarationAfterDeclaratorAndAttributes(clang::Declarator&,
clang::Parser::ParsedTemplateInfo const&, clang::Parser::ForRangeInit*) + 3509
18 clang 0x000000000199d48f
clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&, unsigned int, bool,
clang::SourceLocation*, clang::Parser::ForRangeInit*) + 1695
19 clang 0x000000000198c34a
clang::Parser::ParseDeclOrFunctionDefInternal(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec&, clang::AccessSpecifier) + 794
20 clang 0x000000000198be20
clang::Parser::ParseDeclarationOrFunctionDefinition(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*, clang::AccessSpecifier) + 384
21 clang 0x000000000198b1e1
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*) + 3393
22 clang 0x000000000198a414
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&) + 388
23 clang 0x00000000019861f6 clang::ParseAST(clang::Sema&, bool, bool)
+ 422
24 clang 0x0000000001313c39 clang::FrontendAction::Execute() + 57
25 clang 0x00000000012e7ee3
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 787
26 clang 0x000000000138012c
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 2844
27 clang 0x00000000006c5963 cc1_main(llvm::ArrayRef<char const*>,
char const*, void*) + 675
28 clang 0x00000000006c3b54 main + 7732
29 libc.so.6 0x00007f3555ebf78d __libc_start_main + 237
30 clang 0x00000000006c1bf1
Stack dump:
0. Program arguments: clang -cc1 test.cc -fsyntax-only -std=c++11
1. test.cc:5:44: current parser token 'Run'
2. test.cc:3:10: lambda expression parsing
3. test.cc:3:15: in compound statement ('{}')
4. test.cc:4:3: parsing struct/union/class body 'S'
Segmentation fault (core dumped)</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>