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

    <tr>
        <th>Summary</th>
        <td>
            Clang rejects valid implicit capture of constexpr variables
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            clang
      </td>
    </tr>

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

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

<pre>
    The following [program](https://godbolt.org/z/shzn8aGTP) is rejected in all versions of Clang:
```
int main() {
  constexpr int n{};
  [] { 
    n;   // error: variable 'n' cannot be implicitly captured in a lambda with no capture-default specified
  };
}
```
Actually using `n` (i.e., reading it's value) makes the error go away. 

This looks somewhat related to https://github.com/llvm/llvm-project/issues/57760, though this has nothing to do with `noexcept`, and this one is not a regression; it's been this way for all versions of Clang.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJycU81uoz4QfxpzGRWBCQEOHJJG-V__h77AYE-wt8ZGtkmaPv3KkLSrVU8rIT489vD7GgxBj5aoZ_WR1acMl6ic78VodcSgssHJe_-mCC7OGHfTdgRWH2fvRo8Tq0-MtyrGObDqwPiZ8fPo5OBMzJ0fGT9_Mn4O6tO2-N_b_4x3oAN4-kUikgRtAY2BK_mgnQ3gLvBq0I6pV3FixYHti8e1fmobYUJtGW9TK9Yct3UA4WyI9DF7SHtsqjQnVn3VN3LpBDyXACyrjgCwwQby3nlWHeCKXuNgCBhvLOMNCLTWRRgI9DQbLXQ0dxA4x8U_SIDBaZAINx0VWPcsvki64GIihJmEvmiSX3j-QJfef2J7EHFBY-6whFX1fWHZvgDGW51TzvgreEKZSjoy3gS4olkoCTPhOwWIijZSMDrAG97zB_ft_qZ0AOPce4DgJropjODJYDImOvjLVB3VMuTCTYyfjbk-Hy-zd8lMxs86hIUC4-e6afZFgheVW0YFMf1IYQDrokpwowPpNq0SKUcfgubItkNo5XbCWUphScojeBo9hZSS5NmD70Bkt703vMPF-Z_TlGeyr2RXdZhRXzZV0TW7uuoy1ZedaPCCHVaNJMnr5lIXsuE4NILLVnSZ7nnBd2VZNGVR1lWXFztRta3oJA0Sy25gu4Im1CZPYqTIZ6sMfVnWvO0ygwOZsI4W52KNNudpyny_qjcsY2C7wugQw3eLqKOhfsX-mJXVWy2_8vcMWOL4Hf1ncEO2eNP_u4EP8Nee_w4AAP__XJ1Nrg">