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

    <tr>
        <th>Summary</th>
        <td>
            [Clang] error "in-class initializer for static data member is not a constant expression" where gcc compiles fine
        </td>
    </tr>

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

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

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

<pre>
    When trying to compile the following code I receive the following compilation error on clang, but it compiles fine on gcc. 
As far as i understand this should compile
```
in-class initializer for static data member is not a constant expression
```



```
#include <cmath>
#include <iostream>

template <typename t1, typename t2>
inline constexpr int add(t1 a, t2 b)
{return a + b;}

constexpr int foo(int value)
{
        return (int)std::pow(2, 7);
}

template < size_t num>
class testClass
{
public:
        static const constinit size_t number = foo(num);
};

struct PrincipleData
{
        testClass<6> orders;
};

int main(){
    PrincipleData data;
    std::cout << decltype(data.orders)::number << std::endl;
}
```

[Compiler explorer link of the code](https://godbolt.org/z/nb4K6xfzd)
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJysVM9v8zYM_WvoC9HAluLEOfjQJl-AYZfddhxkiY61yZIh0e3X_vWDnF9tv2CnAYFig3yPjxT9VEr25IlaqF-gPhRq5iHE1les3osumPf2z4E8cny3_oQcUIdxso6QB8I-OBfeckAHQ_gbRtJkX38NZohiGzxSjCFi8Kid8icQe-xmRstX3oS99ZQTTlqvEMoDlM_PCXsVUSW0OHtDMbHyBnmwCdMQZmeu8HM-bMrLb3m1_kk7lRJab9kqZz8oYh8iJlZsNRrFCkcaO4poE_rAqFAHn6sw0s8pUko2-IfkD85vCUJar91sCEHu9ah4APnjUcyGxJHUeA8vJ9M4OcVLCr9P5NVIyFWe3f1V3EDWuzzBRX_WjtYzKmNANFyhWmACOxC7S5HtSySeo0eFIF6wA_kC28NnBV-5-hBANPnpVbmZPhNdQbsL4zkPxC6xAfkM8nkKbyAakVVsM1JeMV8rfu4Zk_2gvxj9fJ_M-T6ZEu_z0zcB09w5q3PBq57LTS-NnM-8C5-Y892DPFyay6W-ibs9L2fiOGvGP6L12k6ODorVr1O465P7DcgfGGJe3v_gzVMdlfUgmizgyoWIX2stO3vD5vBtwjrMnMeWJ2dIu7wjIJoMWF3q59Zy6q3vJfnGQN64BxfzcO_rl_35y4v5Q3EhUkRn_T8Y-sUFsjFAfQDRDMxTygXEEcTxFEwXHK9CPIE4foA4-m79--Zn_2FA7ArTSrOTO1VQW22abbUVu6oqhraupJKlNFpu1kpuelOprtyuu66uy1J0urCtKIUsN9WuqspGVqtadaVRlWlIrbu-0bAuaVTWrZx7HXP5wqY0U7uRstkWTnXk0mKGQnh6wyUIQmRvjG3GPHXzKcG6dDZxurOwZbe46H4xtvpwsToQ4n_zHyHwbaBI2Ru_GmYxR9d-m7DlYe5WOowgjlnm5e9piuFv0gziuDSXQByX5v8NAAD__7p22qM">