<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/81191>81191</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Instantiation of class template causes instantiation of static data member's definition
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
BobBugs
</td>
</tr>
</table>
<pre>
According to C++20 [\[temp.inst\]/3.1](https://timsong-cpp.github.io/cppwp/n4868/temp.inst#3.1) the definition of static data member `i` should not be instantiated, and therefore the program must compile:
```c++
template <class T>
class C {
static const int i = T::value;
};
C<void> x;
```
Clang 17.0.1 instantiates it, and compilation fails. [Demo](https://godbolt.org/z/EGPr6Gf8Y).
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJxsUk1vpDoQ_DXNpRVk2gzgA4f5CNG7vcO7vKOxPYxXxkbYJLv761fATJLNroSMjauL6uqSMdrBG9PC4QSHSyaXdAtzewr9aRli1gf9oz0qFWZt_YAp4BnoBHQihlvFGQ6nZMYptz6m7XgB6nhebJvmltIUgR-BOqAu2TEGPzypacoHm25Ln9sA1KlpepuAOl82VbPi3gmJr1QkMN0ManO13iYbPIYrxiSTVahlkjiasTczQsUsVAzjLSxOow8Je4MrkfTJymQ00Bml1yvdbK5hNhvxNIdhliOOS0yowjhZZ1bR7ALssVZsf9Te__51FepkMgj8rJyMEf8D_rzf7eczQn0HI-JDtAo-JrQ-oUXgl7XqCPz4Kt1igN_xUF8-9tt6Bn5-DVYDf8bvH3cPab9BnfQDFnXO8uKzAxFtepiwdyo3Q6_SupivM72YMfxteEPQfXApD_MA1P0E6p5f_p2rl2vzP5DIM91yLbiQmWmLmtUlNVRSdmurnhXSVL1QQmnSQhXiehBClEaxsuA8sy0xKhmxhgpeE-Wi0VXDqG5IqYNgAkpmRmld7tzruP4_szEupm2KQhSZk71xccsvkTdvuF0C0RrnuV1rnvpliFAyZ2OKHyzJJmfaf97NuQdrH9z7aJVc4mrbV9if-QOq46eQZsvs2i8e7qFXYQTqVh3319M0h29GJaBuUx-Buq27XwEAAP__3pYdtQ">