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

    <tr>
        <th>Summary</th>
        <td>
            clang miscompilation with consteval functions called implicitly in destructor
        </td>
    </tr>

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

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

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

<pre>
    https://godbolt.org/z/MzaPMraqK


This code incorrectly produces runtime error instead of compilation error in checking fmt::format string

```cpp

#include <fmt/core.h>

template<typename T>
struct scope_exit {
   T val;
constexpr ~scope_exit() {  val(); }
};

int main() {
 scope_exit x([]() { std::string s = fmt::format("{}"); });
}

```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJxsU8FupDAM_ZpwsTpinGGAA4e2LJdVpT30vgqJB7INCZuE2baH_fZVYNSZViuhEOxn-9l-iBD0YIkaVjywos3EEkfnmxcyvbNZ79RbM8Y4B8bvGXYMu8Gp3pm4c35g2L0z7J7exY8nL35_Z3nL8vvb83nUAaRTBNpK5z3JaN5g9k4tkgL4xUY9EZD3zoO2IZJQ4E4g3TRrI6J29sMJciT5ou0ApykmOvz-5PwkIoTotR0-VT_m2yPn-ZMdubbSLIqA8ceUBzvpPO1Gxr_dAiNNsxGRGH-MbzNZMRE8f2BC9IuMEKSb6Se96gisfNhcAPAMZ2EYvxikS229zh7-XvEMK4Z1ioIVvH4y_gCsbC80yvYjxXZqG2ES2l5jLxVvaLwm57rImwohqm1c25wgAOPt1yGueExJyzZdrnTW25XU_6acqYarmtcio2Zf4vF4KCpeZGPTV4iSTscqPymOosa9OPYoECveK9znmW4wx0Ne76u8LHJe7FAdilpiUVRIvDzW7JDTJLTZGXOekugyHcJCzT6v8_qYGdGTCat4EaURdkjkizbzTQq465chsENudIjhmiLqaKhZ4TDpcKu2PzqOsO3sLAycFiuTPYAUxpACPc1GS51krC0o2qTgfLZ48_VP0XFc-p10E8Mu1b687mbvfpFM2lt7CQy7SzvnBv8FAAD__4K6FCE">