<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/57627>57627</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
The expression of `static_assert` is not an immediate function context
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
JohelEGP
</td>
</tr>
</table>
<pre>
See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106485#c2.
See https://godbolt.org/z/4GMxo13vv.
```C++
#include <string>
consteval auto s() { return std::string(); }
static_assert(s().empty()); // Only Clang accepts.
// static_assert([]() consteval { return s().empty(); }()); // All accept.
// static_assert([]() { return s().empty(); }()); // All reject.
```
I think `static_assert(s().empty());` should also be rejected by Clang.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJylU0uP2yAQ_jX4gmoRsB3nwCGPzaqVqlZq7yseE5uWQGRwNtlfX_zY7SrNoVUlbBjm8X3DzEivr_wbAG5jPAXE1oju02qUyhvX575rkiT75sVYK9IxtP75Kcm5agxie6MR2y1IVdQlokzRHJEdIuvpfyes19LbOId9SV_x-PniF-x8fvWsyLS2iG6GNd1SZpyyvQaM2DbEzrgGsYdJqbwLEc7CYtFHjwOiNaIrjJYb3EHsO4dD1AMFtp49RwPENslmN8UIUUSjnkQI0MWkn4PkcDzF62w_u4yJ4C_OXvHWCtdgoRScYnhNYNLfBkTlBpW7mdpvxu9J3oGcKd7BX1s7A_8D7n-hdfADVLwt0_t6f8SxNe4nTtd__Z7JFqee6q3GwgaPJcxAoLGcXzjPgC-qilZluWDLTHOmV2wlsmiiBf69BQyXUwchGO-wP_yJnzBMwM5HLBw2xyNoIyLgQ-9UHHxSPSJcYtZ3lt80rIltL3Plj0mw9vy6fTh1fmCZRBNCDym_fbms6DJreVWCXBEFRJKqIlATBpIUi7LQlZSE6swKCTbwoTSUOnjGY4h0TpXKDKeEUrIi9aJidbnMldakrmVV6oIRVR5QQeAojM0HHsMkZR0fKaWpDElpTUjN-KZMT2AaB8CnTsjSjLS-4598C_bh8Ws2YvOR-y_XEDMS">