<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style id="owaParaStyle" type="text/css">P {margin-top:0;margin-bottom:0;}</style>
</head>
<body ocsi="0" fpstyle="1">
<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;"><br>
<div>Hi all,<br>
<br>
I was inspecting the AST dump of this switch:<br>
<br>
<font face="Courier New">void test_switch(int t) {<br>
  switch(t)<br>
  {<br>
  case 1:<br>
    y = 11; <br>
  case 2:<br>
    y = 9;<br>
    x = 12;<br>
    break;<br>
  default:<br>
    break;<br>
  }<br>
}</font><br>
<br>
and I got something I didn't expect. The second CaseStmt does only contain the first statement that is under it's label. The "x=12;" gets its own Stmt outside the CaseStmt but inside the CompoundStmt inside the SwitchStmt. I would anticipate that all statements
 under a label either are: inside the CaseStmt or: outside but inside the CompoundStmt. Any reason for this?.<br>
<br>
<br>
<font face="Courier New">SwitchStmt 0x5bf6fe8<br>
|-<<<NULL>>><br>
|-ImplicitCastExpr 0x5bf6fd0 'int' <LValueToRValue><br>
| `-DeclRefExpr 0x5bf6fa8 'int' lvalue ParmVar 0x5bf6e80 't' 'int'<br>
`-CompoundStmt 0x5bf7258<br>
  |-CaseStmt 0x5bf7038<br>
  | |-IntegerLiteral 0x5bf7018 'int' 1<br>
  | |-<<<NULL>>><br>
  | `-BinaryOperator 0x5bf70b8 'int' lvalue '='<br>
  |   |-DeclRefExpr 0x5bf7070 'int' lvalue Var 0x5bf6cf0 'y' 'int'<br>
  |   `-IntegerLiteral 0x5bf7098 'int' 11<br>
  |-CaseStmt 0x5bf7100<br>
  | |-IntegerLiteral 0x5bf70e0 'int' 2<br>
  | |-<<<NULL>>><br>
  | `-BinaryOperator 0x5bf7180 'int' lvalue '='<br>
  |   |-DeclRefExpr 0x5bf7138 'int' lvalue Var 0x5bf6cf0 'y' 'int'<br>
  |   `-IntegerLiteral 0x5bf7160 'int' 9<br>
  |-BinaryOperator 0x5bf71f0 'int' lvalue '='<br>
  | |-DeclRefExpr 0x5bf71a8 'int' lvalue Var 0x5bf6e10 'x' 'int'<br>
  | `-IntegerLiteral 0x5bf71d0 'int' 12<br>
  |-BreakStmt 0x5bf7218<br>
  `-DefaultStmt 0x5bf7238<br>
    `-BreakStmt 0x5bf7228<br>
<br>
</font><br>
Best regards,<br>
Per Viberg<br>
<br>
<div style="font-size:13px; font-family:Tahoma">
<p class="MsoNormal"><span style="font-size:8pt; font-family:'Arial','sans-serif'; color:gray" lang="EN-US">.......................................................................................................................</span><span style="font-size:8pt; font-family:'Arial','sans-serif'; color:black" lang="EN-US"><br>
Per Viberg </span><span style="font-size:8pt; font-family:'Arial','sans-serif'; color:gray" lang="EN-US">Senior Engineer</span><span style="font-size:8.5pt; font-family:'Arial','sans-serif'; color:gray" lang="EN-US"><br>
Evidente ES East</span><span style="font-size:8pt; font-family:'Arial','sans-serif'; color:gray" lang="EN-US"> AB  Warfvinges väg 34  SE-112 51 Stockholm  Sweden
</span><span style="font-size:10pt; font-family:'Tahoma','sans-serif'; color:black" lang="EN-US"></span></p>
<p class="MsoNormal"><span style="font-size:8pt; font-family:'Arial','sans-serif'; color:gray" lang="EN-GB">Phone:    +46 (0)8 402 79 00<br>
Mobile:    +46 (0)70 912 42 52<br>
E-mail:     <a href="mailto:Per.Viberg@evidente.se" target="_blank"><font color="#0000ff">Per.Viberg@evidente.se</font></a>
</span><span style="font-size:8pt; font-family:'Arial','sans-serif'; color:black" lang="EN-GB"><br>
<br>
<a href="http://www.evidente.se" target="_blank"><font color="#0000ff">www.evidente.se</font></a></span></p>
<p class="MsoNormal"><span style="font-size:6pt; font-family:'Arial','sans-serif'" lang="EN-GB">This e-mail, which might contain confidential information, is addressed to the above stated person/company. If you are not the correct addressee, employee or in
 any other way the person concerned, please notify the sender immediately. At the same time, please delete this e-mail and destroy any prints. Thank You.</span></p>
</div>
</div>
<div style="font-family: Times New Roman; color: #000000; font-size: 16px">
<hr tabindex="-1">
<br>
</div>
</div>
</body>
</html>