<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 --- - Clang crashes on lambda with multiple return statements"
href="http://llvm.org/bugs/show_bug.cgi?id=16708">16708</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Clang crashes on lambda with multiple return statements
</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>C++11
</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>dgregor@apple.com, llvmbugs@cs.uiuc.edu
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>Repro:
int Foo;
int Bar;
void test () {
auto L = []() {
auto ret = Foo;
return ret;
return Bar;
};
}
Command line:
clang -cc1 -std=c++11 test.cc
>From clang/lib/Sema/SemaStmt.cpp:2550, attempting to call getDeducedType() on
NewAT, which is null.
2548 if (AT->isDeduced() && !FD->isInvalidDecl()) {
2549 AutoType *NewAT = Deduced->getContainedAutoType();
2550 if (!Context.hasSameType(AT->getDeducedType(),
NewAT->getDeducedType())) {
2551 Diag(ReturnLoc, diag::err_auto_fn_different_deductions)
2552 << (AT->isDecltypeAuto() ? 1 : 0)
2553 << NewAT->getDeducedType() << AT->getDeducedType();
2554 return true;
(gdb) p NewAT
$2 = (clang::AutoType *) 0x0</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>