<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 --- - Is AST for switch statement correctly?"
href="http://llvm.org/bugs/show_bug.cgi?id=15916">15916</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Is AST for switch statement correctly?
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>unspecified
</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>-New Bugs
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>denis.varin@gmail.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>Steps to Reproduce:
1) Write simple code:
int main() {
int a = 0;
switch (a) {
case 0:
if (!a) break;
if (a) break;
break;
}
}
2) Run a command for print AST:
clang++ -cc1 -ast-dump main.cpp
Actual Results:
typedef char *__builtin_va_list;
int main() (CompoundStmt 0x9eb7020 </tmp/main.cpp:1:12, line:10:1>
(DeclStmt 0x9eb6e90 <line:2:5, col:14>
0x9eb6e40 "int a =
(IntegerLiteral 0x9eb6e78 <col:13> 'int' 0)")
(SwitchStmt 0x9eb6ec8 <line:4:2, line:9:2>
<<<NULL>>>
(ImplicitCastExpr 0x9eb6eb8 <line:4:10> 'int' <LValueToRValue>
(DeclRefExpr 0x9eb6ea0 <col:10> 'int' lvalue Var 0x9eb6e40 'a' 'int'))
(CompoundStmt 0x9eb7000 <col:13, line:9:2>
(CaseStmt 0x9eb6f00 <line:5:9, line:6:21>
(IntegerLiteral 0x9eb6ee8 <line:5:14> 'int' 0)
<<<NULL>>>
(IfStmt 0x9eb6f78 <line:6:13, col:21>
<<<NULL>>>
(UnaryOperator 0x9eb6f58 <col:17, col:18> '_Bool' prefix '!'
(ImplicitCastExpr 0x9eb6f48 <col:18> '_Bool' <IntegralToBoolean>
(ImplicitCastExpr 0x9eb6f38 <col:18> 'int' <LValueToRValue>
(DeclRefExpr 0x9eb6f20 <col:18> 'int' lvalue Var 0x9eb6e40 'a'
'int'))))
(BreakStmt 0x9eb6f70 <col:21>)
<<<NULL>>>))
(IfStmt 0x9eb6fd8 <line:7:13, col:20>
<<<NULL>>>
(ImplicitCastExpr 0x9eb6fc0 <col:17> '_Bool' <IntegralToBoolean>
(ImplicitCastExpr 0x9eb6fb0 <col:17> 'int' <LValueToRValue>
(DeclRefExpr 0x9eb6f94 <col:17> 'int' lvalue Var 0x9eb6e40 'a'
'int')))
(BreakStmt 0x9eb6fd0 <col:20>)
<<<NULL>>>)
(BreakStmt 0x9eb6ff8 <line:8:3>))))
Expected Results:
Why second IfStmt isn't child of CaseStmt?
clang --version
Ubuntu clang version 3.0-6ubuntu3 (tags/RELEASE_30/final) (based on LLVM 3.0)
Target: i386-pc-linux-gnu
Thread model: posix</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>