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

    <tr>
        <th>Summary</th>
        <td>
            [consteval] clang++ sometimes reports false-positive errors for static consteval member functions
        </td>
    </tr>

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

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

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

<pre>
    When I have a CRTP that uses it's client's function, if that client's function happens to be `static consteval`, `clang++` reports an error.

```c++
template <class T>
struct base
{
    constexpr auto foobar() const -> int {
        return static_cast<T const*>(this)->bar(); // error: call to consteval function 'foo::bar' is not a constant expression
    }
};

struct foo : base<foo> {
    static consteval auto bar() -> int {
        return 0;
    }
};

foo x;
int i = x.foobar();
```

live: https://godbolt.org/z/KG5oT6GTj
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyFU02PmzAQ_TXmMkpEzFc4cNhNNquql6qK1GNlzCR4ZTCyTZr213cM-dptpUUOEI_nzZs3j9o0v6sfLfbwBVpxQhCw-b7_Br4VHkaHDpRnvHAgtcJ-fj2MvfTK9IxvQB3mo_8JE94wYO_AG6gRWB47L7ySIE3vPJ6Epq2AQQ-pRX9k_DmsPAaLg7HegegBrTV2yeIti58ud8qalrwkTLseu0ELT3WSDaE5B3uWvMwx5-0oPdTC4QWiuGQBXTOd82BBjET1YEwtLONrxss5BgtCAtV7eJcXLot-tD3Mjf2Uwnkqv5_TGH8KDPjat8oRWEC5IbPkGRjf0Zo7ZMkTSKF1EOumz11KEpZ40SFaE0YBykFvPM1rOi6IXegBnQuTuZFkxfba8pZqPup4UYVwIVSf1Ek2U5mX951-nNss1F2lT_WJb6U_4RTInG97AVIRuS2cl49juSddrfCIodUJQ0Ot94MLkk0yH01TG-2XxpLPdn_o9_U1M_v8df8WNVXSlEkpIq-8xoplz3eLZlt4MCc406FXHX0XV48ehHa4GIxTngrP06RdY_-VrcOuRnubqotGq6sPNJVvx3opTUd_tD5dH4vBmjeUZKqdcm5EMtQuy3maR22VyfIgk3UqD1zmeZM2oilqnqYyEXWSi1WkRY3ahb4Y5z3-ggmC3qm7SFU85jzOebHK4nKVLlGkoiwxLZp1ncisYWmMnVB6GXgE_SJbTZTq8egoqJXz7h6kT08de5xkDPjkldZQRiM0mVNEU-1q4v4XImddbw">