[LLVMbugs] [Bug 17082] New: The variable declaration in a catch() does not appear in -ast-dump

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Sep 3 07:39:27 PDT 2013


http://llvm.org/bugs/show_bug.cgi?id=17082

            Bug ID: 17082
           Summary: The variable declaration in a catch() does not appear
                    in -ast-dump
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: labath at google.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

$ 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.

-- 
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/20130903/2215b0d0/attachment.html>


More information about the llvm-bugs mailing list