<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </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 - traversal a COMPOUND_STMT return false number of children"
   href="https://bugs.llvm.org/show_bug.cgi?id=39739">39739</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>traversal a COMPOUND_STMT return false number of children
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>5.0
          </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>libclang
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>abc19899@foxmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>klimek@google.com, llvm-bugs@lists.llvm.org, richard-llvm@metafoo.co.uk
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=21137" name="attach_21137" title="python code">attachment 21137</a> <a href="attachment.cgi?id=21137&action=edit" title="python code">[details]</a></span>
python code

I am using libclang's pythong binding to parse C++ source.
consider these C++11 code:

  1 #include <vector>
  2 #include <iostream>
  3 
  4 int main()
  5 {
  6   std::vector<int> vi = {1, 2, 3, 4};
  7   for(auto &&i: vi)
  8   {
  9     std::cout << i << std::endl;
 10   }
 11 }
 12 

I can find a cursor type(CursorKind.COMPOUND_STMT) start(<SourceLocation file
'test_code.cpp', line 5, column 1>) end(<SourceLocation file 'test_code.cpp',
line 11, column 2>)
but if i can get_children, it returns only one cursor
type(CursorKind.DECL_STMT) start(<SourceLocation file 'test_code.cpp', line 6,
column 2>) end(<SourceLocation file 'test_code.cpp', line 6, column 37>)
there should be more children located from line 7 to 10.

the python code is in attachment and it's running in python3.5</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>