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

    <tr>
        <th>Summary</th>
        <td>
            -ast-print of an extern-C declaration skips closing semi-colon
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            good first issue,
            clang
      </td>
    </tr>

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

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

<pre>
    https://godbolt.org/z/c1K3nMj6f

Given:
```
extern "C" int printf(const char *, ...);

template<typename T> void foo(T val) {
  printf("%d\n", val);
}

int main() {
 foo(10);
}
```

`-Xclang -ast-print` results in:

```
extern "C" int printf(const char *, ...)
template <typename T> void foo(T val) {
    printf("%d\n", val);
}
template<> void foo<int>(int val) {
    printf("%d\n", val);
}
int main() {
    foo(10);
}
```

Notice the missing semi-colon after the 'printf' declaration.  This comes back if `extern "C"` is not there.

</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJysVE-Pmz4Q_TTDZRTkDH8CBw67yeZ3-Kk97aFXY4bgXWNHthN1--krIG2SVXvoaiUE2Hjee_OesQxBHyxzA8UjFLtEnuLgfMNeq-GVpeWkdd1bM8R4DJA9AO2B9gfXtc7E1PkD0P4H0F6t_8_sl5eyB7ED8bDc_9NntlPRMleKyzUP-XtkbxGItkCE2kY8em1jD1QpZ0NENUiPQA9AW0zTFKiG7PEWP_J4NDIyZNv4dmQrR8ZnyJ7w7HSHvXNA1TOepQGqETaXWrzyABFQ0UGxtfPr9rL4yrPZ3RJOIkep7Vx6C7lwrcWfa-8b_z25-qaMtAdcyRBXsyYoBXoOJxMD6hvnPs2_O9vwX337kHM3Id1RZNup4ewJqJq0fxLbXxNC_EBIX13UijEOjKMOQdsDBh71SjnjLMo-sp8_Am1-ad1gx8pIL6N2NkV8HnRA5UYO2Er1irpHKMV9eFPsOqB1cULznC7sSddkXZ3VMuFmvVmXuSDKN8nQKK6lFO1alX2XS7lWvcqytqWyqMqiq_NENyQoFwXRuqJcbFLV14JEX8qaVVVQBbngUWqTGnMep9840SGcuKkzURWJkS2bMJ8IRAfnOuy1DxHnNUsAQDRv3mlU7BLfTECr9nQIkAujQwxX6Kij4ea6y9H1KC0uHqy2t4ZheNXHgMq4d2YnJ2_eH0I6Dqc2VW4E2k9kl8fq6N0Lqwi0nwUHoP3S17mhnwEAAP__vMZprA">