<html>
<head>
<base href="https://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 with switch containing static local inside invalid function"
href="https://llvm.org/bugs/show_bug.cgi?id=26584">26584</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>crash on invalid with switch containing static local inside invalid function
</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>richard-llvm@metafoo.co.uk
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>This causes Clang to crash / assert:
#define A B B B B B B B B B B
#define B C C C C C C C C C C
#define C D D D D D D D D D D
#define D E E E E E E E E E E
#define E F F F F F F F F F F
#define F { int n = 0; (void)n; }
void f() { A }
class Foo {};
class Bar {
void Baz();
};
namespace {
void Bar::Baz() {
switch (0) static Foo foo;
switch (0) static Foo foo;
switch (0) static Foo foo;
}
The assertion is:
include/llvm/ADT/SmallVector.h:164: reference
llvm::SmallVectorTemplateCommon<clang::SwitchStmt *, void>::back() [T =
clang::SwitchStmt *]: Assertion `!empty()' failed.
within clang::Sema::ActOnFinishSwitchStmt(clang::SourceLocation, clang::Stmt*,
clang::Stmt*).</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>