[LLVMbugs] [Bug 15916] New: Is AST for switch statement correctly?
bugzilla-daemon at llvm.org
bugzilla-daemon at llvm.org
Mon May 6 03:39:31 PDT 2013
http://llvm.org/bugs/show_bug.cgi?id=15916
Bug ID: 15916
Summary: Is AST for switch statement correctly?
Product: clang
Version: unspecified
Hardware: PC
OS: Linux
Status: NEW
Severity: normal
Priority: P
Component: -New Bugs
Assignee: unassignedclangbugs at nondot.org
Reporter: denis.varin at gmail.com
CC: llvmbugs at cs.uiuc.edu
Classification: Unclassified
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
--
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/20130506/9c70cad6/attachment.html>
More information about the llvm-bugs
mailing list