<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/63277>63277</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            python libclang parser incorrect handling of ::iterator
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          d-e-e-p
      </td>
    </tr>
</table>

<pre>
    parsing the following code with libclang:

```
#include <vector>
int main() {
  const std::vector<int> i_is_ok;
  const std::vector<int>::const_iterator i_iter_becomes_const_iterator;
  return 0;
}
```

incorrectly produces AST that looks like:
```
TRANSLATION_UNIT s: class_iter.cpp 
    FUNCTION_DECL s: main t: int () 
        COMPOUND_STMT 
 DECL_STMT 
                VAR_DECL s: i_is_ok t: const int 
 DECL_STMT 
                VAR_DECL s: **const_iterator** t: const int 
            RETURN_STMT 
                INTEGER_LITERAL 
```

this AST dump was produced using script from:
https://gist.githubusercontent.com/scturtle/a7b5349028c249f2e9eeb5688d3e0c5e/raw/fb16f021d2ddcaba9122ad8867aa955c1be4f988/ast_dump.py

see demo at repl:
https://replit.com/join/dowfjffftb-binterboo

LLVM_VER: 16.0.4
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJycVFtv4jgU_jXmxQIldq4PeWAKWVWidEXTvkaOfULcmjiynUH99ysnwNBqZ7RaCwE-l-9cvuPDrJXHHqBA8Q8UbxZsdJ02hVjCEpbDotHisxiYsbI_YtcBbrVS-uxvXAvAZ-k6rGTDFeuPiK5RsEHB9TsJLp_5SqjsuRoFYEQffgJ32iC6nZWyd_jEZI9IhkiOUfpjlmPMdW8dtk54dLq--j3I3iG6xbKWttYfiP5Hh1k42dTSgWFOGw_iwNQNcH0CW3_V3kEbcKPpcXAToXTz77VeiuLaGOBOfeLBaDFysHj9UmHXMYeV1h8WK_kBv_r2FaU6rPcvu3X1-LyvX_ePFbaIrjFXzNopuxUfBnzNDePydf8w2W62D7vZ1rcUO__PN_ja3JuHPw_PT38_v-439Uv1VF11HuGL4Nt5Wx_uolw4mAPN7Z_C_R8sRNaIfONnlv0G_u4cttXrYf-nWI_7avvX9lDvHqvtYb3DfyDPdXImS4ynAZ-ZvVIo8Di9BsuNHBxujT7dCOycG3wZiJSIlEdp3eooXTc2owXDde-gdyuuT4iUlrvROAWIlCxtYhrlAck4ifKWQA7QxEmWCQoBj72JYWdEyrYJkzYgoSBCcNawPCSEiSxLUsbyOOZhA1GbZ5nHtK72ma-Gz_uqLAAWcNKYOWxgUL_J3KvkNdN37d9lKfS5fW_b1jXLRvYOTKP1PfRu9_ZUv20PnqUwWQWraCEKKnKaswUUYZIlCQmiOFp0BQeaCJHHosnDhLesgTAVMaQcaBqFEC1kQQJCgySkQRgFcbTKY5EEGRVJluZBy0MUBXBiUq2U-nlaaXNcSGtHKBJK0nShWAPKTiuNkB7OeFIiQvyGM4X3WTbj0aIoUNI6-wvFSaegGD5dp_vbXsN-AYLBt_eMO9YL5YdAt3jeKNdZXYxGFd_HwE_ApZk-0uVnORj9DtwhUk75WUTKKf9_AgAA___7tach">