<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 --- - The variable declaration in a catch() does not appear in -ast-dump"
href="http://llvm.org/bugs/show_bug.cgi?id=17082">17082</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>The variable declaration in a catch() does not appear in -ast-dump
</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>-New Bugs
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>labath@google.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>$ cat /tmp/a.cc
void f() {
try {
}
catch(int x) {
}
}
$ clang -Xclang -ast-dump /tmp/a.cc -c
TranslationUnitDecl 0x47ccf00 <<invalid sloc>>
|-TypedefDecl 0x47cd440 <<invalid sloc>> __int128_t '__int128'
|-TypedefDecl 0x47cd4a0 <<invalid sloc>> __uint128_t 'unsigned __int128'
|-TypedefDecl 0x47cd860 <<invalid sloc>> __builtin_va_list '__va_list_tag [1]'
`-FunctionDecl 0x47cd900 </tmp/a.cc:1:1, line:6:1> f 'void (void)'
`-CompoundStmt 0x47cda80 <line:1:10, line:6:1>
`-CXXTryStmt 0x47cda60 <line:2:3, line:5:3>
|-CompoundStmt 0x47cd9a0 <line:2:7, line:3:3>
`-CXXCatchStmt 0x47cda40 <line:4:3, line:5:3>
`-CompoundStmt 0x47cda28 <line:4:16, line:5:3>
The variable x is not visible anywhere in the above dump. This is because it is
stored as a VarDecl in the CXXCatchStmt. I guess it should be wrapped in a
DeclStmt so that we can easily iterate over it.</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>