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

    <tr>
        <th>Summary</th>
        <td>
            Possible incorrect code generation when using variable templates
        </td>
    </tr>

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

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

    <tr>
      <th>Reporter</th>
      <td>
          jonas-eschmann
      </td>
    </tr>
</table>

<pre>
    Hello,

I'm encountering an issue with member variables not being initialised properly after moving from GCC to clang. I managed to boil it down to the following minimal example:

```
template <typename T>
struct A{
    int x = 10;
};

template <typename T>
struct B{
    A<T> a;
};

template <typename T>
A<T> a;

template <typename T>
auto aa = a<T>;

template <typename T>
B<T> b = {
 aa<T>
};

int main(){
    return b<float>.a.x;
}
```

[Same example on the compiler explorer](https://godbolt.org/z/5aG8TWzTx)

I'm expecting it to return `10` (which GCC does) but clang returns `0`

Best regards!
Jonas
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJycVEuP4zYM_jX0hZjAkfyIDz7ksdluTwU6QM-0zdha6GFI8iSzv76Qk-l0tlugWyBQLIr89JH6SApBjZa5hfIA5SmjJU7Ot1-dpfDEoZ8MWZt1bnhtf2GtHYgj5CfI9_f1C4jaINveLTayV3ZEsqhCWBivKk5o2HTs8YW8ok5zQOsidpwclVVRkVaBB5y9m9nrV6RLZI_GvSSPi3cGPx-PGB32muy4wS9oyNLIQ7J1TmlUEQd3tWkfJ8aL09pdU7RRVhnSyDcys2aQ-78zhyp__NZtZDNriowgj_F1ZkuG8Rnkp_txiH7pI-6hPtwNiIjKRrwhyBNuc5CPA6hP798_AX34AL0HeUwuSP8f-EcY_yWOluiQaE2MHhg_h3B4u7lbQd4zo7_w_iWlVFJDyoLYgWg-lMRzXLzFDuTxoh1FkJ82tLl9qM-PXvaxloffE8mHGNDZVS29M7PS7JFvs3aePZQnELspxjkkwYgziPPohs7puHF-BHH-BuJc0ufd8x_fnm-J5D_b4TZzH1eJxyTLB3Oo8m2ihSB210n10yrtwXEA0WC3xLvGH-4h-X-fxYFDRM8j-SGA2N6Nv6ZezYZWDo1sKON2W9VlXsiiqLOpLbZ0qSTlRA0N1UU2hRzqHRVlU7Eod9tMtSIXMt_KPN-WeVFvqCqbnkkK4rripoAiZ0NKb7R-MakI2drfbZXLWmaaOtZhHR9CWL7emx-ESNPEtynmqVvGAEWuVYjhHSWqqLn9zYWgOs2obO-85z5i7wbGkS17ispZvE5scQmpoG9zBN8UGLLF6_a791JxWrpN7wyIc7ru8fc0e_eV-wjivJIMIM5rEn8GAAD__4G4gIg">