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

    <tr>
        <th>Summary</th>
        <td>
            Explicit inner struct specialization is not included in AST
        </td>
    </tr>

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

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

    <tr>
      <th>Reporter</th>
      <td>
          Vindicatory
      </td>
    </tr>
</table>

<pre>
    I'm trying to parse sample code with calling 
`clang -Xclang -ast-dump -ferror-limit=0 sample.cpp`


```
#include "BAD"
#include "VERYBAD"

template <typename T>
struct my_struct
{
 struct inner {
      T a;
   };
};

extern int test;

template<>
struct my_struct<int>::inner
{
};

extern int test2;
```

The last two node are 
```
|-VarDecl 0x2034635a608 <line:25:1, col:12> col:12 test 'int' extern
`-VarDecl 0x2034635a870 <line:32:1, col:12> col:12 test2 'int' extern
```

But If I remove #include "VERYBAD", there is still one "fatal error message", but now, AST includes that template specialization.

What is the logic behind this parser behavior? Why are 2 errors critical and one is not? And is there a way to somehow ignore them?


</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJyEVFtvtDYQ_TXmZbQrY8OSfeCB7GalvLZRvvapMmYCroyN7CGb7a-vDOTSS9oVErMzx2eO54KK0fQOsWblPSvPmZpp8KF-Nq4zWpEPt6z13a1-ZKIagcLNuB7Iw6RCRIhqnCyC9h3C1dAAWlmbEIw37MC1Va6H3S_bW0XadfM4we4FQ_BhZ81oiMkz34j2eprYgafD63Pg28MbJqRx2s4dAhPivjkzIf7hfn746dfPEG8Ix8kqQmDyRLcJnRoRnph8YLyJFGZNMN5-W610orpnvIEtYpzDAJtv-T2BYnL7y6rzan8avME3wuDAOALCSB_-dx1Mnr5JLk_GUYrJhslmSf0h6D8yiC3wtVC8eRoQrIoEdPXgUnNUQPg7rjrtnlU4o7bA3wSXxUGW6sDvUrGscchkI0omm5yJE2hvkymYfPiwFwXARJWkiwpWbWuaf6G-q_gXain-l1p8w_31qvczweMLPELA0b-mIfhmHsQJaMCAYCJEMtaCdwvmRZGysAwkjBij6nHDtzOB89dkNj8_wcYbgQaVqr-NVpxQG2XNH4qMd_tV1o8EMQmKYH1vNLQ4GNcBDSauyxOSS70aH5i8wI_htjRJrEoi6GDIaGVBuW6RaiI4TwnbuG7jDggKruqWNjL6EQd_BdM7HzBFRyYvq5ysq2V3lEeVYZ1XsqpycVcV2VAfj7LtjpxLXZT5QSOXZavVXVdKqY-yE5mpBRclz0WRc57nxb4qUBS8zCslq0OBLSs4jsrYvbWv496HPjMxzljnohDFMbOqRRuXr4sQDq-wRFOBy3MW6nRo1859ZAW3JlL8pCFDFuuHt8kabd63cdubv9Z8K817gzowLjUsm4OtB6IppqUSFyYuvaFhbvfaj0xcUqbttZuC_x01MXFZ9EUmLtsFXmvxZwAAAP__dfKToA">