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

    <tr>
        <th>Summary</th>
        <td>
            DeclPrinter: Wrong output of out-of-line declaration of variables of template classes
        </td>
    </tr>

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

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

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

<pre>
    The following code

```
template <class T> struct test {
        static const T var = 1;
};

template <class T> const T test<T>::var;
```

is printed as

```
template <class T> struct test {
    static const T var = 1;
};
const T var;
```

using clang -Xclang -ast-print ... see https://godbolt.org/z/oocr7x8MW


I suspect that it is a problem of DeclPrinter and not of the AST itself.

We are working on a fix...
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJytUk2L2zAQ_TX2ZYjxt-KDDtmmhR4KhQbSq2yPbbWKFTTyZttf37GakOweFgo1sjSjkd68eaPW9r_kYUIYrDH2oucROttjlO6jdHed6_Q6guvxdDbKI0TFh84oIjhExUcg75bOg0fyEImnG0BDXnndMejMgQM8K8cX95BFxe2M2N_t9zLcINYUHFn3omLHgzHvCK_J_p01wdnp2WMPiv5TacDfP9X2cOp9tguFLhjF8-b7dVXkN6EGSJIECBEm78-0CpB_4jHavrXGJ9aN7P3m39rOiZftl-OrgsP8GWihM641TcqD5kGgWCPbGjyBHWCPnfkaJHOg5h5m69dtzw9l9-3ANwjNkDxiHhGUQ7hY93Olb2cGHPQLs41RZnWdV2XRlE3cy6JvikbFXnuD8iER1wJHZ9fLiz8vISFbGztsjJ4Rej6qHCvO2BxiHbVivhSI3ToX2oYUL87INwppPy1t0tkTO8Y83xaW1f5gLdjVRAsSG5Wo0yyeZDZUahBNOwgxiLTq6zytsyyrRVU1XbZtYqNaNCSj6inK8xkvECDYjqp9rGWe5nnapCJtyqrcJgWLkNdNVxZ9XuRtF5UpnpQ2ycpjbV3sZKDULiNx0GjydA9yZXqcEUM6xleLn6yT_Dz1yRZiG4fkMpD_A5aiKSw">